/*@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap');*/

/* Persian Font integration */
@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Medium.ttf") format("truetype");
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    --primary-color: #00897b;
    --primary-hover: #00695c;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #2c3e50;
    --text-muted: #607d8b;
    --border-color: #cfd8dc;
    --error-color: #e53935;
    --error-bg: #ffebee;
    --success-color: #43a047;
    --success-bg: #e8f5e9;
    --focus-ring: rgba(0, 137, 123, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    /* Vazirmatn added as the primary font for Farsi support */
    font-family: "Vazirmatn", system-ui, -apple-system, sans-serif,
    "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji";
    background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.login-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.login-card {
    background: var(--card-bg);
    padding: 1.8rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
    backdrop-filter: blur(10px);
}

h1 {
    color: var(--primary-color);
    font-size: 1.7rem;
    margin-bottom: 0.2rem;
    font-weight: 800;
    text-align: center;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    text-align: center;
}

.form-group {
    margin-bottom: 0.8rem;
    position: relative;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.7rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: #f8fafc;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px var(--focus-ring);
}

input.input-error {
    border-color: var(--error-color);
    background-color: var(--error-bg);
}

.error-hint {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.2rem;
    min-height: 1.1em;
    display: block;
}

.pwd-input-wrap { position: relative; }

.pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.pwd-toggle:hover { color: var(--text-main); }

/* Checkbox & Button */
.checkbox-group { display: flex; flex-direction: column; margin-bottom: 0.5rem; }
.checkbox-wrapper { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem; border-radius: 4px; transition: all 0.2s; }
.checkbox-wrapper input { width: 1.1rem; height: 1.1rem; cursor: pointer; accent-color: var(--primary-color); }
.checkbox-wrapper label { margin-bottom: 0; cursor: pointer; font-weight: normal; }

.btn-primary {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
    font-family: inherit;
}

.btn-primary.btn-disabled {
    background: #90a4ae;
}

.btn-primary:not(.btn-disabled):hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(0, 137, 123, 0.4);
}

/* Alerts */
.alert {
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert.error {
    background: var(--error-bg);
    color: var(--error-color);
    border: 1px solid #f5c6cb;
    display: block;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid #c3e6cb;
    display: block;
}

/* Auth Links (Below Form) */
.auth-links {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 540px) {
    .login-card {
        padding: 1.5rem 1.25rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .btn-primary {
        font-size: 0.95rem;
        padding: 0.75rem;
    }
}