/* ═══════════════════════════════════════════════════════════════════════
   registration-fields.css — Ummah Khairukum Pendaftaran Santri Baru
   Field layout, labels, inputs, radios, upload, and validation states.
   STRICT DESIGN.md COMPLIANCE — Token-first, no color invention.
   ═══════════════════════════════════════════════════════════════════════ */

.reg-hide {
    display: none !important;
}

.reg-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reg-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

.reg-field {
    position: relative;
    background-color: var(--md-surface);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow var(--md-motion-duration-short) var(--md-motion-easing-standard);
}

.reg-field:focus-within {
    background-color: var(--md-surface);
    border-color: transparent;
    box-shadow: none;
}

.reg-field.has-error {
    border-color: transparent;
    background-color: rgba(255, 218, 214, 0.16);
}

.reg-field.has-error:focus-within {
    border-color: transparent;
}

.reg-fieldset {
    position: relative;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background-color var(--md-motion-duration-short) var(--md-motion-easing-standard);
    min-width: 0;
    background-color: var(--md-surface);
}

.reg-fieldset.has-error {
    border-color: transparent;
    background-color: rgba(255, 218, 214, 0.16);
}

.reg-label {
    font-size: var(--md-type-label-large-size);
    font-weight: 600;
    line-height: var(--md-type-label-large-lh);
    letter-spacing: 0.1px;
    color: var(--md-text);
    display: block;
}

.reg-required {
    color: var(--md-error);
    margin-left: 1px;
    font-weight: 500;
}

.reg-field-hint {
    font-size: var(--md-type-body-small-size);
    line-height: var(--md-type-body-small-lh);
    letter-spacing: 0.4px;
    color: var(--md-text-sub);
}

.reg-input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    background-color: var(--md-surface-low);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--md-text);
    font-family: var(--font-family);
    font-size: var(--md-type-body-medium-size);
    line-height: var(--md-type-body-medium-lh);
    letter-spacing: 0.25px;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color var(--md-motion-duration-short) var(--md-motion-easing-standard);
}

.reg-input::placeholder {
    color: var(--md-text-sub);
    font-weight: 400;
}

.reg-input:hover {
    background-color: var(--md-surface-low);
}

.reg-input:focus {
    background-color: var(--md-surface-low);
}

.reg-textarea {
    min-height: 120px;
    height: auto;
    padding: 12px 14px;
    resize: vertical;
    line-height: var(--md-type-body-medium-lh);
}

.reg-input[type="number"]::-webkit-inner-spin-button,
.reg-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.reg-input[type="number"] {
    -moz-appearance: textfield;
}

.reg-input-group {
    display: flex;
    align-items: stretch;
    background-color: var(--md-surface-low);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: background-color var(--md-motion-duration-short) var(--md-motion-easing-standard);
}

.reg-input-group:has(.reg-input--prefixed:focus),
.reg-input-group:has(.reg-input--prefixed:hover) {
    background-color: var(--md-surface-low);
}

.reg-input-prefix {
    display: flex;
    align-items: center;
    padding: 0 10px 0 14px;
    font-size: var(--md-type-label-large-size);
    font-weight: 500;
    letter-spacing: 0.1px;
    color: var(--md-text);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}

.reg-input--prefixed {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    min-width: 0;
    box-shadow: none !important;
    transition: none !important;
}

.reg-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.reg-select {
    padding-right: 40px;
    cursor: pointer;
}

.reg-select-arrow {
    position: absolute;
    right: 12px;
    font-size: 20px;
    color: var(--md-text-sub);
    pointer-events: none;
    transition: transform var(--md-motion-duration-short) var(--md-motion-easing-emphasized),
                color var(--md-motion-duration-short) var(--md-motion-easing-standard);
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
}

.reg-select:focus + .reg-select-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--md-primary);
}

.reg-radio-group {
    display: flex;
    gap: 10px;
}

.reg-radio-chip {
    flex: 1;
    cursor: pointer;
    position: relative;
}

.reg-radio-chip input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.reg-radio-chip-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 64px;
    padding: 12px 10px;
    background-color: var(--md-surface-low);
    border-radius: var(--radius-sm);
    font-size: var(--md-type-label-large-size);
    font-weight: 500;
    letter-spacing: 0.1px;
    color: var(--md-text-sub);
    user-select: none;
    text-align: center;
    transition: background-color var(--md-motion-duration-short) var(--md-motion-easing-standard),
                color var(--md-motion-duration-short) var(--md-motion-easing-standard);
}

.reg-radio-chip-body .material-symbols-rounded {
    font-size: 20px;
    line-height: 1;
}

.reg-radio-chip:hover .reg-radio-chip-body {
    background-color: var(--md-surface-low);
    color: var(--md-text);
}

.reg-radio-chip:has(input:checked) .reg-radio-chip-body {
    background-color: #163829;
    color: #ffffff;
    font-weight: 600;
}

.reg-method-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reg-method-card {
    cursor: pointer;
    position: relative;
}

.reg-method-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.reg-method-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    min-height: 56px;
    background-color: var(--md-surface-low);
    border-radius: var(--radius-sm);
    user-select: none;
    transition: background-color var(--md-motion-duration-short) var(--md-motion-easing-standard);
}

.reg-method-card:hover .reg-method-body {
    background-color: var(--md-surface-low);
}

.reg-method-card:has(input:checked) .reg-method-body {
    background-color: #163829;
}

.reg-method-icon {
    font-size: 20px;
    color: var(--md-text-sub);
    flex-shrink: 0;
    line-height: 1;
    transition: color var(--md-motion-duration-short) var(--md-motion-easing-standard);
}

.reg-method-card:has(input:checked) .reg-method-icon {
    color: #ffffff;
}

.reg-method-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.reg-method-text strong {
    font-size: var(--md-type-label-large-size);
    font-weight: 600;
    letter-spacing: 0.1px;
    color: var(--md-text);
}

.reg-method-text small {
    font-size: var(--md-type-body-small-size);
    letter-spacing: 0.4px;
    color: var(--md-text-sub);
    font-weight: 400;
}

.reg-method-check {
    font-size: 18px;
    color: transparent;
    flex-shrink: 0;
    transition: color var(--md-motion-duration-short) var(--md-motion-easing-standard);
    line-height: 1;
}

.reg-method-card:has(input:checked) .reg-method-check {
    color: #ffffff;
}

.reg-method-card:has(input:checked) .reg-method-text strong,
.reg-method-card:has(input:checked) .reg-method-text small {
    color: #ffffff;
}

.reg-choice-fieldset {
    padding: 16px;
}

.reg-choice-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.reg-choice-group--program {
    grid-template-columns: 1fr;
}

.reg-choice-chip {
    cursor: pointer;
    position: relative;
}

.reg-choice-chip input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.reg-choice-chip-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 16px;
    background-color: var(--md-surface-low);
    border-radius: var(--radius-sm);
    user-select: none;
    text-align: center;
    transition: background-color var(--md-motion-duration-short) var(--md-motion-easing-standard),
                color var(--md-motion-duration-short) var(--md-motion-easing-standard);
}

.reg-choice-chip-text {
    font-size: var(--md-type-label-large-size);
    font-weight: 600;
    line-height: var(--md-type-label-large-lh);
    letter-spacing: 0.1px;
    color: var(--md-text);
}

.reg-choice-chip:hover .reg-choice-chip-body {
    background-color: var(--md-surface-low);
}

.reg-choice-chip:has(input:checked) .reg-choice-chip-body {
    background-color: #163829;
}

.reg-choice-chip:has(input:checked) .reg-choice-chip-text {
    color: #ffffff;
}

.reg-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 28px 24px;
    background-color: var(--md-surface-low);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: background-color var(--md-motion-duration-short) var(--md-motion-easing-standard);
}

.reg-dropzone:hover {
    background-color: var(--md-surface-low);
}

.reg-dropzone.is-dragover {
    background-color: var(--md-surface-low);
    border-color: transparent;
    box-shadow: none;
}

.reg-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.reg-dropzone-icon {
    font-size: 28px;
    color: var(--md-primary);
    line-height: 1;
}

.reg-dropzone-title {
    font-size: var(--md-type-title-small-size);
    font-weight: 500;
    letter-spacing: 0.1px;
    color: var(--md-text);
}

.reg-dropzone-sub {
    font-size: var(--md-type-body-small-size);
    letter-spacing: 0.4px;
    color: var(--md-text-sub);
}

.reg-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px;
    height: 36px;
    border-radius: var(--radius-button);
    background-color: var(--md-surface);
    color: var(--md-text);
    font-family: var(--font-family);
    font-size: var(--md-type-label-large-size);
    font-weight: 600;
    letter-spacing: 0.1px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: background-color var(--md-motion-duration-short) var(--md-motion-easing-standard),
                transform var(--md-motion-duration-short) var(--md-motion-easing-emphasized);
    user-select: none;
}

.reg-upload-btn:hover {
    background-color: var(--md-surface);
    transform: none;
}

@media (min-width: 680px) {
    .reg-choice-group--program {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.reg-upload-btn:active {
    transform: none;
}

.reg-upload-btn .material-symbols-rounded {
    font-size: 16px;
}

.reg-file-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--md-type-body-small-size);
    letter-spacing: 0.4px;
    color: var(--md-text-sub);
    min-height: 18px;
}

.reg-file-name .material-symbols-rounded {
    font-size: 14px;
    flex-shrink: 0;
}

.reg-file-name-text {
    word-break: break-word;
}

.reg-error-msg {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: var(--md-error-container);
    color: var(--md-on-error-container);
    border-radius: var(--radius-sm);
    font-size: var(--md-type-body-small-size);
    font-weight: 500;
    line-height: var(--md-type-body-small-lh);
    letter-spacing: 0.4px;
}

.reg-error-msg .material-symbols-rounded {
    font-size: 16px;
    color: var(--md-error);
    flex-shrink: 0;
}

.reg-field.has-error .reg-error-msg,
.reg-fieldset.has-error .reg-error-msg {
    display: flex;
}
