/* ================= ACTIVATION FORM ================= */

#activation-form {
    margin-top: 20px;
    border: 1px solid #ccc;
    padding: 15px;
}

/* ===== GRID ===== */
#activation-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Full width */
#activation-form .form-group.full {
    grid-column: span 2;
}

/* ===== LABEL ===== */
#activation-form .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
}

/* Required */
#activation-form .required {
    color: red;
}
.hint-text {
    font-size: 12px;
    color: #777;
    display: block;
    margin-top: 4px;
}

.error-text {
    font-size: 9px;
    color: red;
    /* display: block; */
    margin-top: 4px;
}

.input-error {
    border-color: red !important;
}
/* ===== INPUTS ===== */
#activation-form input,
#activation-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

/* Focus */
#activation-form input:focus,
#activation-form select:focus {
    outline: none;
    border-color: #1F509A;
    box-shadow: 0 0 0 2px rgba(31, 80, 154, 0.15);
}

#activation-form input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}


/* ===== STEPS ===== */
#activation-form .form-step {
    display: none;
}

#activation-form .form-step.active {
    display: block;
}

/* ===== BUTTON AREA ===== */
#activation-form .step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ===== PRIMARY BUTTON ===== */
#activation-form .btn-primary {
    background-color: #1F509A;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

#activation-form .btn-primary:hover {
    background-color: #163d75;
}

/* ===== SECONDARY BUTTON ===== */
#activation-form .btn-secondary {
    background-color: transparent;
    color: #1F509A;
    border: 1px solid #1F509A;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

#activation-form .btn-secondary:hover {
    background-color: #f0f4fb;
}

/* ===== SELECT2 FIX ===== */
/* RTL: flip select2 arrow to left side */
html[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 8px;
    right: auto;
}

html[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-right: 8px;
    padding-left: 28px; /* make room for arrow on left */
    text-align: right;
}

html[dir="rtl"] .select2-container--default .select2-selection--single {
    direction: rtl;
}

html[dir="rtl"] .select2-dropdown {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .select2-search--dropdown .select2-search__input {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .select2-results__option {
    text-align: right;
    padding-right: 8px;
}


#activation-form .select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
}

#activation-form .select2-selection__rendered {
    line-height: normal;
    font-size: 14px;
}

/* Focus state */
#activation-form .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #1F509A;
    box-shadow: 0 0 0 2px rgba(31, 80, 154, 0.15);
}

/* Dropdown */
.select2-dropdown {
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* Hover option */
.select2-results__option--highlighted {
    background-color: #1F509A !important;
    color: #fff !important;
}

/* ===== PROGRESS BAR ===== */
#activation-form .progress-bar {
    background: #eee;
    height: 6px;
    border-radius: 4px;
    margin-bottom: 15px;
}

#activation-form #progress-bar-activation {
    height: 6px;
    width: 25%;
    background: #1F509A;
}
/* OTP layout */
/* ===== OTP ===== */

.otp-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
}

#otp_countdown {
    font-size: 11px;
    color: #888;
    text-align: center;
    min-width: 60px;
    min-height: 16px;        /* always reserves space even when empty */
    font-variant-numeric: tabular-nums;
    direction: ltr;
    visibility: hidden;      /* use visibility instead of display:none */
}

#otp_countdown.active {
    visibility: visible;
}
.otp-phone-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.otp-phone-row input {
    flex: 1;
    min-width: 0;
}

.otp-code-row {
    margin-top: 8px;
    opacity: 0.45;
    pointer-events: none;
    transition: opacity .2s;
}

.otp-code-row.active {
    opacity: 1;
    pointer-events: auto;
}

#activation-form #otp_input {
    width: 100%;
    text-align: center;
    letter-spacing: 18px;
    padding-left: 22px;
    font-size: 20px;
    font-weight: 500;
    font-family: monospace;
}

.btn-otp {
    height: 42px;        /* matches input height */
    padding: 0 16px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid #1F509A;
    border-radius: 6px;   /* matches other inputs */
    background: #fff;
    color: #1F509A;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}

.btn-otp:hover:not(:disabled) {
    background: #f0f4fb;
}

.btn-otp:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

.btn-otp.sent {
    border-color: #2e9e6b;
    color: #2e9e6b;
}

.otp-verified-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
    background: #e6f7f0;
    color: #1a7a4e;
    margin-left: 6px;
    vertical-align: middle;
}

#otp_status {
    display: block;
    font-size: 12px;
    margin-top: 5px;
    min-height: 16px;
}


/* ===== ERROR ===== */
#activation-form .error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 3px;
}

.upload-progress {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 4px;
    margin-top: 8px;
    display: none;
}

.upload-bar {
    height: 100%;
    width: 0%;
    background: #1F509A;
    border-radius: 4px;
    transition: width 0.2s;
}

/* ===== SUCCESS ===== */
#activation-success {
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}

/* ===== SUBMIT SPINNER ===== */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

#submit-activation:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}


/* ===== MOBILE ===== */
@media (max-width: 600px) {

    /* stack phone input and send button vertically */
    .otp-phone-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    /* button full width below phone input */
    .otp-phone-row .btn-otp {
        width: 100%;
        height: 42px;
    }

    /* countdown centers under button */
    .otp-btn-wrap {
        width: 100%;
    }

    #otp_countdown {
        text-align: center;
        display: block;
        width: 100%;
    }

    /* otp code input full width */
    .otp-code-row {
        margin-top: 6px;
    }

    .otp-code-row input {
        width: 100%;
        height: 42px;
        font-size: 22px;
        letter-spacing: 16px;
        padding-left: 18px;
    }

    /* status message */
    #otp_status {
        font-size: 12px;
        text-align: center;
        display: block;
    }

    /* verified badge wraps nicely */
    .otp-verified-badge {
        display: inline-block;
        margin-top: 4px;
        margin-left: 0;
    }

}


@media (max-width: 600px) {
    #activation-form .form-grid {
        grid-template-columns: 1fr;
    }

    #activation-form .form-group.full {
        grid-column: span 1;
    }
}
