:root {
    --color-primary: #1976d2;
    --color-primary-dark: #1565c0;
    --color-primary-light: #bbdefb;
    --color-on-primary: #ffffff;
    --color-background: #f4f6f8;
    --color-surface: #ffffff;
    --color-error: #d32f2f;
    --color-error-bg: #fdecea;
    --color-error-light: #f8bbd0;
    --color-text: rgba(0, 0, 0, 0.87);
    --color-text-secondary: rgba(0, 0, 0, 0.6);
    --color-border: #d7dce1;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.12), 0 6px 16px rgba(0, 0, 0, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/Vazirmatn-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/Vazirmatn-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/vazirmatn/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

html {
    direction: rtl;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Vazirmatn", sans-serif;
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Main */
.app-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Auth card */
.auth-card {
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 32px;
    width: 100%;
    max-width: 400px;
}

.auth-card--wide {
    max-width: 560px;
}

.auth-card--center {
    text-align: center;
}

.auth-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.auth-card__header--center {
    justify-content: center;
}

.auth-logo {
    width: 120px;
    height: auto;
    flex-shrink: 0;
}

.auth-card__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.auth-card__subtitle {
    margin: 0 0 24px;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.auth-card__links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    font-size: 0.875rem;
}

.auth-card__links a {
    color: var(--color-primary);
    text-decoration: none;
}

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

/* Text fields */
.field {
    position: relative;
    margin-bottom: 20px;
}

.field__input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: transparent;
    font: inherit;
    font-size: 1rem;
    color: var(--color-text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.field__input--ltr {
    direction: ltr;
    text-align: left;
}

.field__input-wrap {
    position: relative;
}

.field__input-wrap .field__input {
    padding-right: 48px;
}

.field__toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color 0.15s ease;
}

.field__toggle:hover {
    color: var(--color-text);
}

.field__toggle-icon {
    width: 20px;
    height: 20px;
}

.field__toggle-icon--hide {
    display: none;
}

.field__toggle.is-visible .field__toggle-icon--show {
    display: none;
}

.field__toggle.is-visible .field__toggle-icon--hide {
    display: block;
}

.field__label {
    display: block;
    margin-bottom: 6px;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.field__error {
    color: var(--color-error);
    font-size: 0.75rem;
    margin-top: 4px;
}

.field.has-error .field__input {
    border-color: var(--color-error);
}

.field.has-error .field__label {
    color: var(--color-error);
}

.field.has-error .field__input:focus {
    box-shadow: 0 0 0 2px var(--color-error-light);
}

/* Checkbox */
.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}

.checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    padding: 12px 24px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.3);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
}

.btn--primary:active {
    box-shadow: none;
}

.btn--text {
    background: transparent;
    color: var(--color-primary);
}

.btn--text:hover {
    background: var(--color-primary-light);
}

.btn--full {
    width: 100%;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

/* Alert / validation summary */
.alert {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.alert__title {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.alert ul {
    margin: 0;
    padding-inline-start: 20px;
}

.alert li {
    margin: 2px 0;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
