/**
 * Frontend Styles - Login/Register Modal
 * Neutral slate input borders with brand yellow accent icons & register button
 */

/* ── Font Family ─────────────────────────────────────────────────────────── */
.slr-modal-content {
    font-family: iransansxv, tahoma, sans-serif;
}

.slr-modal-content i[class*="fa-"],
.slr-modal-content [class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-style: normal;
}

/* ── User Menu (logged-in state) ─────────────────────────────────────────── */
.slr-user-menu {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.slr-user-name {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
}

.slr-logout-btn {
    padding: 7px 18px;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.slr-logout-btn:hover {
    background: #ffb51f;
    color: #ffffff;
    border-color: #ffb51f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 181, 31, 0.3);
}

/* Menu Style - navigation integration */
.slr-menu-style {
    text-decoration: none !important;
}

.slr-user-menu.slr-menu-style {
    padding: 0;
}

.slr-user-menu.slr-menu-style .slr-user-name {
    color: inherit;
}

/* ── Modal Overlay ───────────────────────────────────────────────────────── */
.slr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* ── Modal Card ──────────────────────────────────────────────────────────── */
.slr-modal-content {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.1);
    padding: 34px 28px 26px;
    animation: slrSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slrSlideIn {
    from {
        opacity: 0;
        transform: translateY(-18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Close Button ────────────────────────────────────────────────────────── */
.slr-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.slr-modal-close:hover {
    background: #ffb51f;
    border-color: #ffb51f;
    color: #ffffff;
    transform: rotate(90deg);
}

/* ── Form Container ──────────────────────────────────────────────────────── */
.slr-form-container {
    display: none;
}

.slr-form-container.active {
    display: block;
    animation: slrFadeIn 0.25s ease;
}

@keyframes slrFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Form Heading ────────────────────────────────────────────────────────── */
.slr-form-container h2 {
    text-align: center;
    margin: 0 0 6px;
    font-size: 1.3rem;
    color: #0f172a;
    font-weight: 750;
    font-variation-settings: "wght" 750, "DOTS" 8;
    letter-spacing: -0.01em;
}

.slr-form-desc {
    text-align: center;
    color: #64748b;
    margin: 0 0 20px;
    font-size: 0.84rem;
    line-height: 1.6;
}

/* ── Form Group ──────────────────────────────────────────────────────────── */
.slr-form-group {
    margin-bottom: 12px;
}

.slr-form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    font-variation-settings: "wght" 600, "DOTS" 8;
}

/* ── Input Group (Neutral Borders + Yellow Icon Accent) ─────────────────── */
.slr-input-group {
    display: flex;
    position: relative;
    width: 100%;
    align-items: stretch;
}

.slr-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    background: #fffdf2;
    border: 1px solid #cbd5e1;
    border-left: none;
    border-radius: 0 12px 12px 0;
    color: #d97706;
    font-size: 0.92rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.slr-input-group .slr-input {
    border-radius: 12px 0 0 12px;
    height: 44px;
}

.slr-input-group:focus-within .slr-input-icon {
    border-color: #ffb51f;
    background: #ffb51f;
    color: #ffffff;
}

.slr-input-group:focus-within .slr-input {
    border-color: #ffb51f;
    box-shadow: 0 0 0 3px rgba(255, 181, 31, 0.18);
}

/* ── Input Fields (Clean Neutral Slate Borders) ──────────────────────────── */
.slr-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #0f172a;
    box-sizing: border-box;
    font-family: inherit;
}

.slr-input::placeholder {
    color: #94a3b8;
    font-size: 0.82rem;
}

.slr-input:focus {
    outline: none;
    border-color: #ffb51f;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 181, 31, 0.18);
}

.slr-input.error {
    border-color: #ef4444;
    background: #fff5f5;
}

.slr-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ── Password Wrapper ────────────────────────────────────────────────────── */
.slr-password-wrapper {
    position: relative;
}

.slr-password-wrapper .slr-input {
    padding-left: 42px;
}

.slr-toggle-password {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    color: #94a3b8;
    font-size: 0.92rem;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.slr-toggle-password:hover {
    color: #d97706;
    transform: translateY(-50%) scale(1.1);
}

/* ── Password Strength Bar ───────────────────────────────────────────────── */
.slr-password-strength {
    height: 3px;
    border-radius: 99px;
    margin-top: 7px;
    background: #e2e8f0;
    overflow: hidden;
}

.slr-password-strength::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    transition: all 0.35s ease;
    border-radius: 99px;
}

.slr-password-strength.weak::after   { width: 33%; background: #ef4444; }
.slr-password-strength.medium::after { width: 66%; background: #ffb51f; }
.slr-password-strength.strong::after { width: 100%; background: #10b981; }

/* ── Remember Me ─────────────────────────────────────────────────────────── */
.slr-remember-me label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 400;
}

.slr-remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #ffb51f;
}

/* ── Field Error Text ────────────────────────────────────────────────────── */
.slr-error {
    display: block;
    color: #ef4444;
    font-size: 0.76rem;
    margin-top: 4px;
    min-height: 16px;
    font-weight: 500;
}

/* ── Primary Submit Button (Brand Blue) ─────────────────────────────────── */
.slr-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    font-variation-settings: "wght" 700, "DOTS" 8;
    letter-spacing: 0.01em;
}

.slr-btn-primary {
    background: #0871c9;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(8, 113, 201, 0.22);
    margin-top: 4px;
}

.slr-btn-primary:hover {
    background: #075fa8;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(8, 113, 201, 0.32);
}

.slr-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(8, 113, 201, 0.2);
}

.slr-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading spinner on button */
.slr-btn.loading {
    position: relative;
    color: transparent !important;
}

.slr-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: slrSpin 0.65s linear infinite;
}

@keyframes slrSpin {
    to { transform: rotate(360deg); }
}

/* ── Response / Alert Messages ───────────────────────────────────────────── */
.slr-response {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.83rem;
    text-align: center;
    margin-top: 12px;
    display: none;
    font-weight: 500;
    line-height: 1.5;
}

.slr-response.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.slr-response.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Bottom Form Links ───────────────────────────────────────────────────── */
.slr-form-links {
    text-align: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.83rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.slr-link {
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.slr-link:hover {
    color: #d97706;
    text-decoration: underline;
}

.slr-separator {
    color: #cbd5e1;
    font-size: 0.9rem;
}

/* ── Register Button (Yellow Accent Pill) ─────────────────────────────────── */
a.slr-link.slr-show-register {
    background: #fffdf2 !important;
    border: 1.5px solid #ffb51f !important;
    color: #b45309 !important;
    padding: 4px 15px !important;
    border-radius: 30px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    display: inline-block;
    font-size: 0.81rem !important;
    text-decoration: none !important;
}

a.slr-link.slr-show-register:hover {
    background: #ffb51f !important;
    color: #ffffff !important;
    border-color: #ffb51f !important;
    box-shadow: 0 4px 12px rgba(255, 181, 31, 0.3) !important;
}

/* ── Resend Cooldown State ───────────────────────────────────────────────── */
.slr-resend-register-code.slr-cooldown-active,
.slr-resend-reset-code.slr-cooldown-active {
    color: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── OTP / Code Digit Inputs ─────────────────────────────────────────────── */
.slr-code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    direction: ltr;
    margin: 6px 0;
}

.slr-code-digit,
.slr-register-code-digit {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
    font-variation-settings: "wght" 700, "DOTS" 0;
}

.slr-code-digit:focus,
.slr-register-code-digit:focus {
    outline: none;
    border-color: #ffb51f;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 181, 31, 0.18);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .slr-modal-content {
        padding: 26px 18px 20px;
        width: 95%;
        border-radius: 18px;
    }

    .slr-code-digit,
    .slr-register-code-digit {
        width: 38px;
        height: 44px;
        font-size: 1.15rem;
        border-radius: 10px;
    }

    .slr-code-inputs {
        gap: 5px;
    }
}
