/* ==================== SIGNIN WIZARD v3.0 ==================== */
/* Password-First + OTP Fallback Strategy */

.signin-wizard {
    max-width: 420px;
    margin: 0 auto;
    padding: 32px 24px;
    animation: fadeIn 0.3s ease;
}

.signin-logo {
    height: 48px;
    filter: drop-shadow(0 2px 8px rgba(94, 114, 228, 0.2));
}

/* ---- Field Styling ---- */
.signin-wizard .form-floating {
    position: relative;
}

.signin-wizard .form-floating input {
    height: 56px;
    border-radius: 14px;
    border: 1.5px solid #e1e4e8;
    padding: 0 16px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.signin-wizard .form-floating input:focus {
    border-color: #5e72e4;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(94, 114, 228, 0.1);
}

body.night-mode .signin-wizard .form-floating input {
    background: #1a1a1a;
    border-color: #333;
    color: #fff;
}

body.night-mode .signin-wizard .form-floating input:focus {
    background: #0f1112;
    border-color: #5e72e4;
}

/* Field Status */
.field-status {
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
    font-weight: 500;
}

.field-status.error { color: #dc3545; }
.field-status.success { color: #28a745; }
.field-status.loading { color: #ffc107; }

/* ---- Primary Button ---- */
.signin-btn {
    height: 52px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.signin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(94, 114, 228, 0.3);
}

.signin-btn:active:not(:disabled) {
    transform: translateY(0);
}

.signin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Identifier Chip ---- */
.signin-identifier-chip {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #edf2ff 0%, #f8faff 100%);
    border: 1px solid #dbe5ff;
    border-radius: 50px;
    font-weight: 600;
    color: #5e72e4;
    font-size: 14px;
    width: 100%;
    justify-content: space-between;
    margin-bottom: 24px;
}

.signin-identifier-chip button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.signin-identifier-chip button:hover {
    opacity: 1;
}

/* ---- Password Field + Eye Icon ---- */
.password-field {
    position: relative;
}

.password-field input {
    padding-right: 45px !important;
}

.password-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    z-index: 5;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-eye:hover {
    color: #5e72e4;
    background: rgba(94, 114, 228, 0.1);
}

.password-eye svg {
    width: 20px;
    height: 20px;
}

/* ---- Step Actions ---- */
.signin-step-actions {
    display: flex;
    gap: 10px;
}

.signin-step-actions .signin-btn-back {
    background: #f0f3ff;
    border-radius: 14px;
    min-width: 90px;
    border: 1px solid #dbe5ff;
    color: #5e72e4;
    font-weight: 600;
    transition: all 0.3s;
}

.signin-step-actions .signin-btn-back:hover {
    background: #e5edff;
}

/* ---- Divider ---- */
.signin-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #999;
    margin: 24px 0;
}

.signin-divider::before,
.signin-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1e4e8;
}

.signin-divider span {
    font-size: 13px;
    font-weight: 500;
}

/* ---- OAuth Buttons ---- */
.oauth-buttons {
    display: flex;
    gap: 10px;
}

.oauth-btn {
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: all 0.3s;
    flex: 1;
    border: 1.5px solid #e1e4e8;
    background: #fff;
    color: #333;
}

.oauth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #5e72e4;
}

.oauth-btn.oauth-google {
    color: #4285F4;
}

.oauth-btn.oauth-eitaa {
    background: linear-gradient(135deg, #d8a600, #ffc400);
    color: #fff;
    border: none;
}

.oauth-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* ---- OTP Inputs ---- */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
    direction: ltr;
}

.otp-digit,
.otp-digit-forgot {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid #e1e4e8;
    border-radius: 12px;
    transition: all 0.3s;
    background: #f9fafb;
}

.otp-digit:focus,
.otp-digit-forgot:focus {
    border-color: #5e72e4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.15);
    outline: none;
}

body.night-mode .otp-digit,
body.night-mode .otp-digit-forgot {
    background: #1a1a1a;
    border-color: #333;
    color: #fff;
}

/* ---- Links & Helpers ---- */
.signin-helper-links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.signin-helper-links a {
    color: #5e72e4;
    text-decoration: none;
    transition: all 0.2s;
}

.signin-helper-links a:hover {
    text-decoration: underline;
}

/* ---- Timer & Resend ---- */
.otp-timer-block {
    text-align: center;
    margin: 16px 0;
}

.otp-timer {
    font-size: 13px;
    color: #999;
    font-weight: 600;
}

.btn-resend {
    background: none;
    border: none;
    color: #5e72e4;
    cursor: pointer;
    font-size: 13px;
    margin-left: 8px;
    text-decoration: underline;
}

.btn-resend:disabled {
    color: #ccc;
    cursor: not-allowed;
    text-decoration: none;
}

/* ---- New Password Section ---- */
.new-password-section {
    animation: slideDown 0.3s ease;
}

/* ---- Error Alert ---- */
.signin-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 16px;
    animation: slideDown 0.3s ease;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* ---- Step Display ---- */
.signin-step {
    animation: slideDown 0.3s ease;
}

.signin-step.hidden {
    display: none !important;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 576px) {
    .signin-wizard {
        padding: 20px 12px;
    }

    .signin-step-actions {
        flex-direction: column-reverse;
    }

    .signin-step-actions .signin-btn-back {
        width: 100%;
    }

    .oauth-buttons {
        flex-direction: column;
    }

    .oauth-btn {
        width: 100%;
    }

    .otp-inputs {
        gap: 8px;
    }

    .otp-digit,
    .otp-digit-forgot {
        width: 45px;
        height: 52px;
        font-size: 1.3rem;
    }
}

/* ---- Dark Mode ---- */
body.night-mode {
    --color-bg: #0f1112;
    --color-text: #fff;
    --color-border: #333;
}
