@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --text-dark: #0f172a;
    --text-gray: #64748b;
    --bg-input: #f8fafc;
    --border: #e2e8f0;
    --radius: 12px;
    --font: 'Vazirmatn', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }

body {
    font-family: var(--font);
    background-color: #f1f5f9;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    overflow: hidden; /* جلوگیری از اسکرول اضافه */
}

/* کانتینر اصلی دو بخشی */
.auth-wrapper {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 450px 1fr; /* ستون فرم ثابت، ستون عکس منعطف */
    background: #fff;
    overflow: hidden;
}

/* بخش فرم (راست) */
.auth-form-side {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background: #ffffff;
    z-index: 10;
    box-shadow: 5px 0 30px rgba(0,0,0,0.05);
    overflow-y: auto;
}

/* بخش تصویر (چپ) */
.auth-image-side {
    background-image: url('https://images.unsplash.com/photo-1492691527719-9d1e07e534b4?q=80&w=2000&auto=format&fit=crop'); /* عکس کوهستان و عکاس */
    background-size: cover;
    background-position: center;
    position: relative;
}

/* لایه تاریک روی عکس */
.auth-image-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.2));
}

/* متن روی عکس */
.auth-image-text {
    position: absolute;
    bottom: 50px;
    right: 50px;
    color: #fff;
    z-index: 2;
    max-width: 80%;
}
.auth-image-text h2 { font-size: 2.5rem; font-weight: 900; margin-bottom: 10px; }
.auth-image-text p { font-size: 1.1rem; opacity: 0.9; line-height: 1.6; }

/* --- اجزای فرم --- */

/* دکمه بازگشت */
.btn-back {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #f1f5f9;
    color: var(--text-gray);
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
}
.btn-back:hover { background: var(--primary); color: #fff; }

.logo-area { text-align: center; margin-bottom: 30px; }
.logo-area ion-icon { font-size: 4rem; color: var(--primary); }
.logo-area h1 { font-size: 1.8rem; font-weight: 800; color: var(--text-dark); margin: 10px 0 5px; }
.logo-area p { color: var(--text-gray); font-size: 0.95rem; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-dark); font-weight: 600; font-size: 0.9rem; }

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    transition: 0.3s;
}
.form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.5);
}

.divider {
    display: flex; align-items: center; color: var(--text-gray); margin: 25px 0; font-size: 0.9rem;
}
.divider::before, .divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.divider span { padding: 0 10px; }

.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 12px;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dark); font-weight: 600;
    text-decoration: none; transition: 0.3s;
}
.btn-google:hover { background: #f8fafc; border-color: #cbd5e1; }

.auth-footer { text-align: center; margin-top: 25px; color: var(--text-gray); font-size: 0.95rem; }
.auth-footer a { color: var(--primary); font-weight: 700; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* کپچا */
.captcha-row { display: flex; gap: 10px; }
.captcha-img { border-radius: var(--radius); cursor: pointer; height: 52px; border: 1px solid var(--border); }

/* پیام‌ها */
.alert { padding: 15px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ریسپانسیو */
@media (max-width: 900px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-image-side { display: none; } /* در تبلت و موبایل عکس حذف شود تا فرم تمیز بماند */
    .auth-form-side { max-width: 500px; margin: 0 auto; box-shadow: none; background: transparent; }
    body { background: #f1f5f9; overflow: auto; }
}