@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600&display=swap');

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --purple-50:  #f5f3ff;
    --purple-100: #ede9fe;
    --purple-200: #ddd6fe;
    --purple-400: #a78bfa;
    --purple-600: #7c3aed;
    --purple-700: #6d28d9;

    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;

    --red-50:  #fef2f2;
    --red-200: #fecaca;
    --red-500: #ef4444;
    --red-600: #dc2626;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    background-color: var(--slate-100);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

/* ─── Background Pattern ───────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(167, 139, 250, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Wrapper ──────────────────────────────────────────────── */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
}

/* ─── Card ─────────────────────────────────────────────────── */
.login-card {
    background: #fff;
    border-radius: 20px;
    border: 0.5px solid var(--slate-200);
    padding: 40px 36px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.04),
        0 8px 32px rgba(0,0,0,0.06);
}

/* ─── Brand / Header ───────────────────────────────────────── */
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--purple-100);
    color: var(--purple-600);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 0.5px solid var(--purple-200);
}

.login-brand h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-800);
    margin-bottom: 6px;
}

.login-brand p {
    font-size: 13px;
    color: var(--slate-400);
    font-weight: 400;
}

/* ─── Error Alert ──────────────────────────────────────────── */
.alert-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    background: var(--red-50);
    border: 0.5px solid var(--red-200);
    border-radius: 10px;
    color: var(--red-600);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 22px;
}

.alert-error svg {
    flex-shrink: 0;
    color: var(--red-500);
}

/* ─── Field Group ──────────────────────────────────────────── */
.field-group {
    margin-bottom: 18px;
}

.field-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-600);
    margin-bottom: 7px;
}

/* ─── Input with Icon ──────────────────────────────────────── */
.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
    color: var(--slate-400);
    pointer-events: none;
    transition: color 0.15s;
}

.input-wrap:focus-within .input-icon {
    color: var(--purple-600);
}

.input-wrap input {
    width: 100%;
    padding: 11px 38px 11px 14px;
    background: var(--slate-50);
    border: 0.5px solid var(--slate-200);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--slate-800);
    direction: rtl;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    appearance: none;
}

.input-wrap input::placeholder {
    color: var(--slate-400);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.input-wrap input:hover {
    border-color: var(--slate-300);
}

.input-wrap input:focus {
    border-color: var(--purple-400);
    background: #fff;
    box-shadow: 0 0 0 3px var(--purple-100);
}

/* ─── Submit Button ────────────────────────────────────────── */
.btn-login {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--purple-600) 0%, var(--purple-700) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    cursor: pointer;
    margin-top: 8px;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
}

.btn-login:hover {
    opacity: 0.92;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
}

.btn-login:active {
    transform: scale(0.98);
    opacity: 1;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 420px) {
    .login-card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .login-brand h1 {
        font-size: 16px;
    }
}
