/* =============================================
   SIGNIN PAGE — Linear-inspired minimal design
   ============================================= */

.signin-bg {
    min-height: 100vh;
    min-height: 100dvh; /* dynamic viewport height for mobile browsers */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background-color: var(--mud-palette-background, #0F0F0F);
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.035) 1px, transparent 0);
    background-size: 28px 28px;
}

.signin-card {
    width: 100%;
    max-width: 400px;
    background: var(--mud-palette-surface, #141414);
    border: 1px solid var(--mud-palette-divider, rgba(255,255,255,0.08));
    border-radius: 18px;
    padding: 2rem 1.75rem 2.25rem;
}

/* ── Brand row ───────────────────────────────── */
.signin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.75rem;
}

.signin-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    flex-shrink: 0;
    display: block;
}

.signin-brand-name {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    font-weight: 600; /* SemiBold */
    color: var(--mud-palette-text-primary, #F4F4F5);
    letter-spacing: 0.01em;
}

/* ── Heading ─────────────────────────────────── */
.signin-heading {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.3rem;
    font-weight: 700; /* Bold */
    color: var(--mud-palette-text-primary, #F4F4F5);
    margin: 0 0 1.6rem;
    line-height: 1.3;
}

/* ── Error ───────────────────────────────────── */
.signin-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-radius: 10px;
    color: #F87171;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.signin-error svg {
    flex-shrink: 0;
}

/* ── Floating-label fields ───────────────────── */
.signin-float-field {
    position: relative;
    margin-bottom: 1.1rem;
}

/* The actual <input> element */
.signin-float-field input {
    width: 100%;
    height: 56px;               /* comfortable tap target */
    padding: 22px 14px 8px;    /* top-heavy: space for floated label */
    background: var(--mud-palette-background, #0F0F0F);
    border: 1px solid var(--mud-palette-lines-inputs, rgba(255,255,255,0.12));
    border-radius: 10px;
    color: var(--mud-palette-text-primary, #F4F4F5);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;            /* 16px — prevents iOS auto-zoom */
    font-weight: 400;           /* Regular */
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
    direction: rtl;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

/* Focus ring */
.signin-float-field input:focus {
    border-color: #5E6AD2;
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.14);
}

/* Readonly = "admin" field looks inactive */
.signin-float-field input[readonly] {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

/* ── Floating label ──────────────────────────── */
.signin-float-field label {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;           /* Regular — resting state */
    color: var(--mud-palette-text-disabled, #52525B);
    pointer-events: none;
    background: transparent;
    padding: 0 2px;
    line-height: 1;
    transition:
        top         0.18s cubic-bezier(0.4, 0, 0.2, 1),
        font-size   0.18s cubic-bezier(0.4, 0, 0.2, 1),
        font-weight 0.18s cubic-bezier(0.4, 0, 0.2, 1),
        color       0.18s cubic-bezier(0.4, 0, 0.2, 1),
        background  0.18s cubic-bezier(0.4, 0, 0.2, 1),
        padding     0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floated state: label rides the top border */
.signin-float-field input:focus ~ label,
.signin-float-field input:not(:placeholder-shown) ~ label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.72rem;
    font-weight: 500;           /* Medium — floated state */
    background: var(--mud-palette-surface, #141414);
    padding: 0 5px;
}

/* Focused label color */
.signin-float-field input:focus ~ label {
    color: #5E6AD2;
}

/* Non-focused but filled: keep secondary color */
.signin-float-field input:not(:focus):not(:placeholder-shown) ~ label {
    color: var(--mud-palette-text-secondary, #A1A1AA);
}

/* Readonly field label stays in secondary color even when floated */
.signin-float-field input[readonly] ~ label {
    color: var(--mud-palette-text-disabled, #52525B);
}

/* Validation messages */
.signin-float-field .validation-message {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    color: #F87171;
    margin-top: 5px;
    display: block;
    padding-right: 2px;
}

/* ── Submit button ───────────────────────────── */
.signin-btn {
    width: 100%;
    min-height: 48px;          /* iOS HIG minimum tap target */
    padding: 13px;
    margin-top: 1.35rem;
    background: #5E6AD2;
    border: none;
    border-radius: 10px;
    color: #FFFFFF;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    font-weight: 700;          /* Bold */
    letter-spacing: 0.01em;
    cursor: pointer;
    touch-action: manipulation; /* remove iOS tap delay */
    transition: background 0.18s ease, transform 0.1s ease;
    -webkit-appearance: none;
    appearance: none;
}

@media (hover: hover) {
    .signin-btn:hover {
        background: #4F5BBB;
    }
}

.signin-btn:active {
    transform: scale(0.98);
    background: #4A56B0;
}

/* ── Mobile adjustments ──────────────────────── */
@media (max-width: 480px) {
    .signin-bg {
        align-items: flex-start;
        padding-top: 3rem;
        background-image: none; /* cleaner on small screens */
    }

    .signin-card {
        border: none;
        background: transparent;
        border-radius: 0;
        padding: 0 1.25rem;
        max-width: 100%;
    }

    .signin-heading {
        font-size: 1.45rem;
    }
}


/* =============================================
   AUTH CARD — Register, ForgotPassword, Manage
   ============================================= */

.auth-card {
    width: 100%;
    max-width: 480px;
    background: rgba(47, 54, 64, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card-header .auth-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #5E6AD2, #7B85DB);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card-header .auth-icon .mud-icon-root {
    font-size: 1.5rem !important;
    color: white !important;
}

.auth-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.auth-input-group label {
    display: block;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    color: rgba(245, 246, 250, 0.6);
    margin-bottom: 6px;
    font-weight: 500;
}

.auth-input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(30, 39, 46, 0.8);
    border: 1px solid rgba(94, 106, 210, 0.2);
    border-radius: 10px;
    color: #f5f6fa;
    font-size: 1rem;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s ease;
    outline: none;
    direction: rtl;
}

.auth-input-group input:focus {
    border-color: #5E6AD2;
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.15);
}

.auth-input-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-input-group .validation-message {
    color: #F87171;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.78rem;
    margin-top: 4px;
    display: block;
}

.auth-submit-btn {
    width: 100%;
    padding: 13px;
    background: #5E6AD2;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover {
    background: #4F5BBB;
}
