﻿/* ================================================
   Strawberry Accounting — app.css
   Global design tokens, font, and reset.
   Component-specific styles belong in .razor.css
   isolation files, not here.
   ================================================ */

:root {
    /* =========================================================
       BRAND
       ========================================================= */
    /* Main brand / interactive color */
    --color-primary: #2563EB;
    --color-primary-light: #60A5FA;
    --color-primary-dark: #1E40AF;
    /* Growth / positive actions */
    --color-secondary: #10B981;
    --color-secondary-light: #34D399;
    --color-secondary-dark: #059669;
    /* Strawberry brand accent */
    --color-accent: #E31E3C;
    --color-accent-light: #FF4D6D;
    --color-accent-dark: #BE123C;
    /* =========================================================
       LAYOUT
       ========================================================= */

    --color-background: #F8FAFC;
    --color-background-light: #e7ecf2;
    --color-surface: #FFFFFF;
    --color-surface-alt: #FBFAFC;
    /* =========================================================
       HEADER / SIDEBAR
       ========================================================= */

    --color-header: var(--color-primary-dark);
    --color-menu: var(--color-primary-dark);
    --color-menu-hover: var(--color-primary);
    --color-menu-active: var(--color-primary);
    --color-menu-text: #FFFFFF;
    --color-menu-text-muted: #CBD5E1;
    /* =========================================================
       BORDERS
       ========================================================= */

    --color-border: #E2E8F0;
    --color-border-light: #F1F5F9;
    --color-border-dark: #94A3B8;
    /* =========================================================
       TEXT
       ========================================================= */

    --color-text-primary: #1F2937;
    --color-text-secondary: #64748B;
    --color-text-muted: #94A3B8;
    --color-text-inverse: #FFFFFF;
    /* =========================================================
       ICONS
       ========================================================= */

    --color-icon: #64748B;
    --color-icon-active: var(--color-primary);
    /* =========================================================
       STATUS / FEEDBACK
       ========================================================= */

    --color-success: #10B981;
    --color-success-light: #D1FAE5;
    --color-success-dark: #047857;
    --color-warning: #F59E0B;
    --color-warning-light: #FEF3C7;
    --color-warning-dark: #B45309;
    --color-error: #DC2626;
    --color-error-light: #FEE2E2;
    --color-error-dark: #B91C1C;
    --color-info: #3B82F6;
    --color-info-light: #DBEAFE;
    --color-info-dark: #1D4ED8;
    /* =========================================================
       FINANCIAL / ACCOUNTING
       ========================================================= */

    --color-income: #10B981;
    --color-expense: #DC2626;
    --color-balance: #2563EB;
    --color-tax: #9333EA;
    /* =========================================================
       BUTTONS
       ========================================================= */

    --color-button-primary: var(--color-primary);
    --color-button-primary-hover: var(--color-primary-dark);
    --color-button-secondary: var(--color-secondary);
    --color-button-secondary-hover: var(--color-secondary-dark);
    --color-button-accent: var(--color-accent);
    --color-button-accent-hover: var(--color-accent-dark);
    /* =========================================================
       SPACING
       ========================================================= */

    --space-xs: 0.4rem;
    --space-sm: 0.8rem;
    --space-md: 1.2rem;
    --space-lg: 1.8rem;
    --space-xl: 2.4rem;
    /* =========================================================
       RADIUS
       ========================================================= */

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    /* =========================================================
       SHADOWS
       ========================================================= */

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.15);
    /* =========================================================
       TRANSITIONS
       ========================================================= */

    --transition: 0.18s ease;
}

/* =============================================================
   THEME: نقره‌ای
   ============================================================= */

[data-theme="silver"] {
    --color-primary: #64748B;
    --color-primary-light: #94A3B8;
    --color-primary-dark: #475569;
    --color-header: #475569;
    --color-menu: #475569;
    --color-menu-hover: #64748B;
    --color-menu-active: #64748B;
    --color-background: #F1F5F9;
    --color-background-light: #E2E8F0;
    --color-border: #CBD5E1;
    --color-border-light: #E2E8F0;
    --color-border-dark: #94A3B8;
    --color-icon-active: #475569;
    --color-balance: #64748B;
    --color-button-primary: #64748B;
    --color-button-primary-hover: #475569;
}


/* =============================================================
   THEME: آبی
   ============================================================= */

[data-theme="blue"] {
    --color-primary: #2563EB;
    --color-primary-light: #60A5FA;
    --color-primary-dark: #1E40AF;
    --color-header: #1E40AF;
    --color-menu: #1E40AF;
    --color-menu-hover: #2563EB;
    --color-menu-active: #2563EB;
    --color-background: #F8FAFC;
    --color-background-light: #F1F5F9;
    --color-border: #DBEAFE;
    --color-border-light: #EFF6FF;
    --color-border-dark: #93C5FD;
    --color-icon-active: #2563EB;
    --color-balance: #2563EB;
    --color-button-primary: #2563EB;
    --color-button-primary-hover: #1E40AF;
}


/* =============================================================
   THEME: مشکی
   ============================================================= */

[data-theme="black"] {
    --color-primary: #1F2937;
    --color-primary-light: #4B5563;
    --color-primary-dark: #111827;
    --color-header: #111827;
    --color-menu: #111827;
    --color-menu-hover: #1F2937;
    --color-menu-active: #374151;
    --color-background: #F9FAFB;
    --color-background-light: #F3F4F6;
    --color-border: #D1D5DB;
    --color-border-light: #E5E7EB;
    --color-border-dark: #9CA3AF;
    --color-icon-active: #1F2937;
    --color-balance: #1F2937;
    --color-button-primary: #1F2937;
    --color-button-primary-hover: #111827;
}

/* ===== Fonts =====
   Add Shabnam-Bold.woff2 alongside the regular weight if you have it —
   without an explicit bold face, browsers fake-bold Persian text,
   which distorts letterforms more than it does for Latin script. */
@font-face {
    font-family: 'Shabnam';
    src: url('/font/Shabnam/Farsi-Digits/Shabnam-FD.woff2') format('woff2'), url('/font/Shabnam/Farsi-Digits/Shabnam-FD.woff') format('woff');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Shabnam';
    src: url('/font/Shabnam/Farsi-Digits/Shabnam-Bold-FD.woff2') format('woff2'), url('/font/Shabnam/Farsi-Digits/Shabnam-Bold-FD.woff') format('woff');
    font-weight: 700;
    font-display: swap;
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 10px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 12px;
    }
}

@media (min-width: 992px) {
    html {
        font-size: 14px;
    }
}

body {
    font-family: 'Shabnam', Tahoma, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input, select, textarea {
    font-family: inherit;
}

/* ===== Accessibility =====
   Keyboard-navigable focus ring — important for an accounting app
   with heavy tab-based data entry. Placed globally so every future
   input/button/link gets it without remembering to add it per component. */
:focus-visible {
    outline: 2px solid var(--color-primary-light);
    outline-offset: 2px;
}

.input-container {
    background-color: transparent;
    border: thin solid var(--color-border);
    border-radius: 1rem;
    width: 20rem;
    height: 3rem;
    padding-right: var(--space-sm);
    margin: var(--space-md) auto;
    display: flex;
    align-items: center;
    transition: border-color var(--transition), box-shadow var(--transition);
}

    .input-container > span {
        color: var(--color-icon);
        margin: var(--space-xs);
    }

    .input-container:focus-within {
        border-color: var(--color-primary-light);
        box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.12);
    }

    .input-container:has(.invalid) {
        border-color: var(--color-error);
    }

.input-field, .input-field:focus {
    outline: none;
    border: 0;
    background: none;
    font-weight: 400;
    font-size: 1rem;
    line-height: 2rem;
    width: 90%;
    text-align: right;
    color: var(--color-text-primary);
}

select.input-field {
    color-scheme: light;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
}

    select.input-field option {
        color: var(--color-text-primary);
        background-color: var(--color-surface);
    }

.textarea-container {
    margin: var(--space-md) auto;
    background-color: transparent;
    border: thin solid var(--color-border);
    border-radius: var(--radius-md);
    width: 80%;
    max-width: 40rem;
    height: 15rem;
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    white-space: nowrap;
    transition: border-color var(--transition), box-shadow var(--transition);
}

    .textarea-container:focus-within {
        border-color: var(--color-primary-light);
        box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.12);
    }

    .textarea-container textarea {
        font-weight: 400;
        font-size: 1.2rem;
        line-height: 2rem;
        width: 100%;
        text-align: right;
        outline: none;
        border: 0;
        background: none;
        color: var(--color-text-primary);
    }

.section-title {
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 3rem;
    color: var(--color-primary);
}

.subsection-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 2.5rem;
    color: var(--color-primary-light);
    margin-top: var(--space-xs);
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--color-border);
}

/* Layout Style */
.header-strip {
    width: 100%;
    height: 1rem;
    background-color: var(--color-primary-dark);
}

.footer-strip {
    width: 100%;
    height: 1rem;
    background-color: var(--color-primary-dark);
    margin: 0;
    position: fixed;
    bottom: 0;
    z-index: 200;
}

.error-message,
.error-message-small,
.validation-message,
.validation-summary-errors {
    color: var(--color-error);
}

.error-message {
    text-align: center;
    direction: rtl;
}

    .error-message ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .error-message li {
        text-align: center;
    }

/* Card Styling */
.card {
    flex: 1 1 calc(33.33% - 1rem); /* 3 cards per row with gap accounted */
    min-width: 300px;
    background-color: var(--color-surface);
    border-radius: var(--radius-lg); /* was 12px — no exact token, nearest is --radius-lg (14px) */
    padding: 1.25rem;
    box-shadow: var(--shadow-sm); /* was hardcoded rgba(0,0,0,0.06) — now uses your primary-based shadow token */
    transition: var(--transition); /* was "transform 0.2s ease, box-shadow 0.2s ease" */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

    /* Card hover */
    .card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md); /* was hardcoded rgba(0,0,0,0.1) */
    }

@media (max-width: 1024px) {
    .card {
        flex: 1 1 calc(50% - 1rem);
    }
}

@media (max-width: 600px) {
    .card {
        flex: 1 1 100%;
    }
}

/* Row with cards */
.row-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}


/* Title inside the card */
.card-title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: bold;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

/* Quick Access */
.quick-access-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
}

    .quick-access-buttons button {
        min-width: 130px;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
        font-weight: bold;
        color: var(--color-surface); /* was "white" */
        background-color: var(--color-primary);
        border: none;
        border-radius: var(--radius-md); /* was 8px — nearest token is --radius-md (10px) */
        cursor: pointer;
        transition: var(--transition); /* was "background-color 0.3s ease" */
        text-align: right;
        direction: rtl;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .quick-access-buttons button i {
            color: var(--color-surface); /* was "white" */
            font-size: 1rem;
        }

        .quick-access-buttons button:hover {
            background-color: var(--color-primary-dark);
        }

/* Refresh Button*/
.refresh-button-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.refresh-button {
    padding: 8px 12px;
    background-color: transparent;
    color: var(--color-primary);
    border: none;
    border-radius: var(--radius-sm); /* was 5px — nearest token is --radius-sm (6px) */
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition); /* was "color 0.3s ease" */
}

    .refresh-button:hover {
        color: var(--color-primary-dark);
    }

    .refresh-button i {
        margin: 0;
    }

    /*--------------------------------------*/
/* =========================================================
   LOGIN PAGE
   ========================================================= */

.login-page {
    width: 100%;
    min-height: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: radial-gradient( circle at top right, rgba(37, 99, 235, 0.05), transparent 32% ), radial-gradient( circle at bottom left, rgba(255, 45, 85, 0.04), transparent 30% ), #F8FAFC;
    direction: rtl;
}


/* =========================================================
   LOGIN CARD
   ========================================================= */

.login-card {
    position: relative;
    width: 100%;
    max-width: 430px;
    padding: 38px 36px 32px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07), 0 2px 8px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}


    /* Small red accent on top */

    .login-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        width: 82px;
        height: 4px;
        background: #FF2D55;
        border-radius: 0 0 6px 6px;
        transform: translateX(-50%);
    }

/* =========================================================
   BRAND
   ========================================================= */

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}


/* Logo container */

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}


/* Logo background */

.login-logo-mark {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    overflow: hidden;
}


/* Actual image */

.login-image {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: contain;
}


/* Brand title */

.login-brand-title {
    margin-bottom: 6px;
    color: #2563EB;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
}


/* Main title */

.login-brand h1 {
    margin: 0 0 7px;
    color: #1F2937;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.5;
}


/* Description */

.login-brand p {
    margin: 0;
    color: #64748B;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.8;
}


/* =========================================================
   FORM FIELD
   ========================================================= */

.login-field {
    width: 100%;
    margin-bottom: 18px;
}


    .login-field > label {
        display: block;
        margin-bottom: 8px;
        color: #1F2937;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.5;
    }


/* =========================================================
   INPUT WRAPPER
   IMPORTANT:
   Border belongs to .login-input
   ========================================================= */

.login-input {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: #FFFFFF;
    border: 1px solid #DCE3EA;
    border-radius: 13px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}


    /* Hover */

    .login-input:hover {
        border-color: #CBD5E1;
    }


    /* Focus */

    .login-input:focus-within {
        border-color: #FF2D55;
        box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.10);
    }


/* =========================================================
   INPUT ICON
   ========================================================= */

.login-input-icon {
    flex: 0 0 20px;
    width: 20px;
    margin-left: 10px;
    color: #64748B;
    font-size: 14px;
    text-align: center;
    transition: color 0.18s ease;
}


/* Change icon color when field is focused */

.login-input:focus-within .login-input-icon {
    color: #2563EB;
}


/* =========================================================
   ACTUAL INPUT
   NO BORDER
   ========================================================= */

.login-input > input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #1F2937;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    text-align: right;
    direction: rtl;
}


    /* Very important:
   browser focus must not add another border */

    .login-input > input:focus {
        border: none;
        outline: none;
        box-shadow: none;
    }


    /* Placeholder */

    .login-input > input::placeholder {
        color: #94A3B8;
        opacity: 1;
    }


/* =========================================================
   PASSWORD TOGGLE
   ========================================================= */

.password-toggle {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748B;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}


    .password-toggle:hover {
        background: #F1F5F9;
        color: #2563EB;
    }


    .password-toggle:focus-visible {
        outline: 2px solid #2563EB;
        outline-offset: 2px;
    }


/* =========================================================
   LOGIN OPTIONS
   ========================================================= */

.login-options {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    margin-bottom: 22px;
}


/* Remember me */

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #64748B;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
}


    .remember-me input {
        width: 15px;
        height: 15px;
        margin: 0;
        accent-color: #2563EB;
        cursor: pointer;
    }


    .remember-me span {
        line-height: 1.5;
    }


/* Forgot password */

.login-forgot {
    color: #2563EB;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.18s ease;
}


    .login-forgot:hover {
        color: #1E40AF;
        text-decoration: underline;
    }


/* =========================================================
   SUBMIT BUTTON
   ========================================================= */

.login-submit {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 1px solid #FF2D55;
    border-radius: 13px;
    background: #FF2D55;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(255, 45, 85, 0.18);
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}


    .login-submit:hover {
        background: #E31E3C;
        border-color: #E31E3C;
        box-shadow: 0 7px 18px rgba(255, 45, 85, 0.23);
        transform: translateY(-1px);
    }


    .login-submit:active {
        transform: translateY(0);
        box-shadow: 0 3px 9px rgba(255, 45, 85, 0.16);
    }


    .login-submit:focus-visible {
        outline: 2px solid #2563EB;
        outline-offset: 3px;
    }


/* =========================================================
   REGISTER
   ========================================================= */

.login-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    color: #64748B;
    font-size: 11px;
}


.login-register-link {
    color: #2563EB;
    font-weight: 600;
    transition: color 0.18s ease;
}


    .login-register-link:hover {
        color: #1E40AF;
        text-decoration: underline;
    }


/* =========================================================
   VALIDATION / ERROR SUPPORT
   ========================================================= */

.login-field-error {
    margin-top: 6px;
    color: #DC2626;
    font-size: 10px;
    line-height: 1.6;
}


.login-validation {
    width: 100%;
    margin-bottom: 18px;
    padding: 10px 12px;
    border: 1px solid #FECACA;
    border-radius: 10px;
    background: #FEF2F2;
    color: #B91C1C;
    font-size: 11px;
    line-height: 1.7;
    text-align: right;
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.login-input > input:focus-visible {
    outline: none;
}


.login-input:has(input:focus-visible) {
    border-color: #FF2D55;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 600px) {

    .login-page {
        padding: 24px 16px;
    }

    .login-card {
        max-width: 430px;
        padding: 32px 26px 28px;
        border-radius: 19px;
    }

    .login-brand {
        margin-bottom: 26px;
    }

        .login-brand h1 {
            font-size: 19px;
        }

    .login-brand-title {
        font-size: 17px;
    }
}


@media (max-width: 400px) {

    .login-page {
        padding: 18px 12px;
    }

    .login-card {
        padding: 28px 20px 24px;
        border-radius: 17px;
    }

    .login-logo-mark {
        width: 68px;
        height: 68px;
    }

    .login-image {
        width: 52px;
        height: 52px;
    }

    .login-brand h1 {
        font-size: 18px;
    }

    .login-brand p {
        font-size: 11px;
    }

    .login-input,
    .login-submit {
        height: 50px;
    }

    .login-options {
        margin-bottom: 20px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .login-input,
    .login-input-icon,
    .password-toggle,
    .login-submit,
    .login-forgot,
    .login-register-link {
        transition: none;
    }

        .login-submit:hover {
            transform: none;
        }
}
