/* ============================================
   AUTH PAGES - UNIFIED STYLES
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #e8e2da 0%, #d5cdc4 100%);
    padding: 20px;
    margin: 0;
    font-family: var(--font-family);
    direction: rtl;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 40px 36px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    animation: fadeInUp 0.5s ease-out;
}

.auth-card:hover {
    box-shadow: 0 16px 64px rgba(40, 35, 30, 0.25);
}

/* ============================================
   HEADER
   ============================================ */

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.auth-header h1 {
    font-size: var(--h1-size);
    font-weight: var(--font-weight-extrabold);
    color: var(--text-primary);
    margin: 0 0 8px 0;
    font-family: var(--font-family);
}

.auth-header p {
    font-size: var(--body-small);
    color: var(--text-muted);
    margin: 0;
    font-family: var(--font-family);
}

/* ============================================
   MESSAGES
   ============================================ */

.message {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: var(--body-small);
    font-weight: var(--font-weight-semibold);
    text-align: center;
    box-sizing: border-box;
    width: 100%;
}

.message.error {
    background: var(--expense-bg);
    color: var(--expense-color);
    border: 1px solid var(--expense-border);
}

.message.success {
    background: var(--income-bg);
    color: var(--income-color);
    border: 1px solid var(--income-border);
}

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

.auth-form {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    width: 100%;
}

.auth-form .form-group:last-of-type {
    margin-bottom: 28px;
}

.auth-form label {
    font-size: var(--label-size);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    font-family: var(--font-family);
    display: block;
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: var(--input-size);
    font-family: var(--font-family);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
    direction: ltr;
    text-align: right;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(26, 138, 106, 0.12);
    background: var(--bg-card);
}

.auth-form input::placeholder {
    color: var(--text-light);
    font-weight: var(--font-weight-regular);
}

.auth-form .input-hint {
    font-size: var(--body-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   AUTH OPTIONS
   ============================================ */

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: var(--body-small);
}

.auth-options .forgot-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
}

.auth-options .forgot-link:hover {
    text-decoration: underline;
}

.auth-options .timer-text {
    color: var(--text-muted);
}

.auth-options .resend-btn {
    background: none;
    border: none;
    color: var(--primary-green);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    font-size: var(--body-small);
    font-family: var(--font-family);
}

.auth-options .resend-btn:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.auth-options .resend-btn:not(:disabled):hover {
    text-decoration: underline;
}

/* ============================================
   BUTTON
   ============================================ */

.auth-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(145deg, var(--primary-green), var(--primary-green-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--btn-size);
    font-weight: var(--font-weight-bold);
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(26, 138, 106, 0.25);
    box-sizing: border-box;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(26, 138, 106, 0.35);
    background: linear-gradient(145deg, #1a9a72, #0d6e52);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26, 138, 106, 0.20);
}

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

/* ============================================
   FOOTER
   ============================================ */

.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 2px solid var(--border-light);
}

.auth-footer p {
    margin: 0 0 8px 0;
    font-size: var(--body-small);
}

.auth-footer a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-footer small {
    font-size: var(--body-xs);
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
}

/* ============================================
   AUTOFILL STYLES
   ============================================ */

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-card) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background-color: var(--bg-card) !important;
    background-clip: content-box !important;
}

/* ============================================
   ANIMATION
   ============================================ */

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .auth-page {
        padding: 20px;
    }
    
    .auth-card {
        padding: 32px 28px;
    }

    .auth-header h1 {
        font-size: var(--h2-size);
    }

    .auth-logo {
        font-size: 40px;
    }

    .auth-form input {
        padding: 11px 14px;
        font-size: var(--input-small);
    }

    .auth-btn {
        padding: 12px;
        font-size: var(--btn-small);
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 16px;
        align-items: flex-start;
        padding-top: 30px;
    }

    .auth-container {
        max-width: 100%;
    }

    .auth-card {
        padding: 24px 18px;
        border-radius: var(--radius-md);
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .auth-header h1 {
        font-size: var(--h3-size);
        margin-bottom: 6px;
    }

    .auth-logo {
        font-size: 36px;
        margin-bottom: 8px;
    }

    .auth-header p {
        font-size: var(--body-xs);
    }

    .auth-form .form-group {
        margin-bottom: 16px;
    }

    .auth-form .form-group:last-of-type {
        margin-bottom: 22px;
    }

    .auth-form input {
        padding: 10px 14px;
        font-size: var(--body-small);
    }

    .auth-btn {
        padding: 12px;
        font-size: var(--body-small);
    }

    .auth-footer {
        margin-top: 22px;
        padding-top: 16px;
    }
}

@media (max-height: 700px) {
    .auth-page {
        align-items: center;
        padding: 20px;
    }

    .auth-card {
        padding: 28px 24px;
    }

    .auth-header {
        margin-bottom: 20px;
    }

    .auth-logo {
        font-size: 32px;
        margin-bottom: 6px;
    }

    .auth-header h1 {
        font-size: var(--h3-size);
        margin-bottom: 4px;
    }

    .auth-form .form-group {
        margin-bottom: 14px;
    }

    .auth-form .form-group:last-of-type {
        margin-bottom: 20px;
    }

    .auth-form input {
        padding: 10px 14px;
    }

    .auth-btn {
        padding: 11px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .auth-page {
        background: white !important;
    }

    .auth-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .auth-btn {
        background: #333 !important;
        color: white !important;
    }
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    display: none;
}
.message.error {
    display: block !important;
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}
.message.success {
    display: block !important;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}