/* ===== کاریار - استایل مشترک صفحات احراز هویت ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
    --primary:   #8B4513;
    --primary-d: #6B3410;
    --primary-l: #A0522D;
    --accent:    #FF8C00;
    --accent-d:  #E07B00;
    --dark:      #2F1B14;
    --text:      #3D2010;
    --muted:     #8B6E5A;
    --border:    #E8D5C4;
    --bg:        #FDF6F0;
    --white:     #FFFFFF;
    --error:     #DC2626;
    --success:   #16A34A;
    --info:      #2563EB;
    --radius:    16px;
    --shadow-sm: 0 2px 8px rgba(139,69,19,.12);
    --shadow-md: 0 8px 32px rgba(139,69,19,.18);
    --shadow-lg: 0 20px 60px rgba(139,69,19,.22);
    --trans:     all .3s cubic-bezier(.4,0,.2,1);
}

html { height:100%; }

body {
    font-family: 'Vazirmatn', sans-serif;
    min-height: 100vh;
    display: flex;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

/* ===== پنل چپ - تصویری ===== */
.panel-visual {
    flex: 1;
    position: relative;
    background: linear-gradient(145deg, var(--primary-d) 0%, var(--primary) 40%, var(--accent) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    overflow: hidden;
}

.panel-visual::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
    top: -150px; right: -150px;
}
.panel-visual::after {
    content: '';
    position: absolute;
    width: 350px; height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
    bottom: -100px; left: -80px;
}

.wave-bottom { position: absolute; bottom: 0; left: 0; right: 0; }

.visual-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.logo-circle {
    width: 110px; height: 110px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 3px solid rgba(255,255,255,.35);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
    animation: floatLogo 4s ease-in-out infinite;
}

.logo-circle img { width: 75px; height: 75px; border-radius: 50%; object-fit: cover; }

@keyframes floatLogo {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.visual-title {
    font-size: 2.4rem;
    font-weight: 900;
    margin-bottom: .6rem;
    text-shadow: 0 2px 12px rgba(0,0,0,.2);
    letter-spacing: -1px;
}

.visual-sub {
    font-size: 1.05rem;
    opacity: .88;
    margin-bottom: 3rem;
    font-weight: 500;
}

.features { display: flex; flex-direction: column; gap: 1rem; width: 100%; max-width: 320px; }

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    transition: var(--trans);
}

.feature-item:hover { background: rgba(255,255,255,.18); transform: translateX(-4px); }

.feature-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}

.feature-text strong { display: block; font-size: .95rem; font-weight: 700; margin-bottom: 2px; }
.feature-text span   { font-size: .8rem; opacity: .8; }

/* ===== پنل راست - فرم ===== */
.panel-form {
    width: 480px;
    min-width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
    background: var(--white);
    position: relative;
    overflow-y: auto;
}

.panel-form::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 100%;
    animation: gradientSlide 3s ease infinite;
}

@keyframes gradientSlide {
    0%,100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* هدر فرم */
.form-header { margin-bottom: 2rem; }

.form-header h1 {
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: .4rem;
    letter-spacing: -.5px;
}

.form-header p { color: var(--muted); font-size: .92rem; font-weight: 500; }

/* ===== فیلدها ===== */
.field { margin-bottom: 1.3rem; }

.field-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .5rem;
}

.field-label i { color: var(--primary); font-size: .95rem; }

.input-wrap { position: relative; }

.input-wrap input {
    width: 100%;
    padding: .85rem 1rem .85rem 3rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-family: 'Vazirmatn', sans-serif;
    color: var(--text);
    background: var(--bg);
    transition: var(--trans);
    outline: none;
}

.input-wrap input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(139,69,19,.1);
    transform: translateY(-1px);
}

.input-wrap input::placeholder { color: #C4A898; }

.input-icon {
    position: absolute;
    left: 1rem; top: 50%;
    transform: translateY(-50%);
    color: #C4A898;
    font-size: .95rem;
    transition: var(--trans);
    pointer-events: none;
}

.input-wrap input:focus ~ .input-icon { color: var(--primary); }

.toggle-pass {
    position: absolute;
    right: 1rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #C4A898; cursor: pointer;
    font-size: .95rem;
    transition: var(--trans);
    padding: 4px;
}

.toggle-pass:hover { color: var(--primary); }

.input-wrap input[type="password"],
.input-wrap input.pass-field { padding-right: 3rem; }

/* ===== کپچا ===== */
.captcha-box {
    background: linear-gradient(135deg, #FDF0E6 0%, #FEF3E8 100%);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.captcha-question {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
    white-space: nowrap;
}

.captcha-question i { color: var(--accent); }

.captcha-input {
    flex: 1;
    min-width: 80px;
    max-width: 120px;
    padding: .7rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    font-family: 'Vazirmatn', sans-serif;
    background: white;
    color: var(--text);
    outline: none;
    transition: var(--trans);
}

.captcha-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139,69,19,.1);
}

/* ===== پیام خطا ===== */
.alert-error {
    display: flex;
    align-items: center;
    gap: .7rem;
    background: #FEF2F2;
    border: 1.5px solid #FECACA;
    border-right: 4px solid var(--error);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    margin-bottom: 1.3rem;
    color: #991B1B;
    font-size: .88rem;
    font-weight: 600;
    animation: shakeX .4s ease;
}

@keyframes shakeX {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-6px); }
    40%,80% { transform: translateX(6px); }
}

/* ===== دکمه اصلی ===== */
.btn-primary-auth {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 800;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: var(--trans);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(139,69,19,.3);
    letter-spacing: .3px;
    margin-bottom: 1rem;
    text-decoration: none;
}

.btn-primary-auth::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
    transition: left .5s;
}

.btn-primary-auth:hover::after { left: 100%; }

.btn-primary-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139,69,19,.4);
}

.btn-primary-auth:active { transform: translateY(0); }

/* ===== دکمه ثانویه ===== */
.btn-secondary-auth {
    width: 100%;
    padding: .9rem;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: var(--trans);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.btn-secondary-auth:hover {
    background: var(--bg);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ===== جداکننده ===== */
.divider {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: var(--border);
}

/* ===== لینکهای پایین ===== */
.form-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.2rem;
    border-top: 1.5px solid var(--border);
    flex-wrap: wrap;
    gap: .5rem;
}

.form-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 600;
    transition: var(--trans);
    display: flex;
    align-items: center;
    gap: .3rem;
}

.form-links a:hover { color: var(--accent); }
.form-links a i { font-size: .8rem; }

/* ===== فوتر ===== */
.form-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
}

/* ===== پیام موفقیت / اطلاع ===== */
.alert-success {
    display: flex; align-items: flex-start; gap: .7rem;
    background: #F0FDF4; border: 1.5px solid #BBF7D0;
    border-right: 4px solid var(--success);
    border-radius: var(--radius); padding: .9rem 1rem;
    margin-bottom: 1.3rem; color: #166534;
    font-size: .88rem; font-weight: 600;
}

.alert-info {
    display: flex; align-items: flex-start; gap: .7rem;
    background: #EFF6FF; border: 1.5px solid #BFDBFE;
    border-right: 4px solid var(--info);
    border-radius: var(--radius); padding: .9rem 1rem;
    margin-bottom: 1.3rem; color: #1E40AF;
    font-size: .88rem; font-weight: 600;
}

/* ===== کد تایید (SMS) ===== */
.otp-box {
    background: linear-gradient(135deg, #FFF7ED 0%, #FEF3E8 100%);
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.3rem;
}

.otp-code {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 10px;
    color: var(--dark);
    background: white;
    padding: .8rem 1.5rem;
    border-radius: 12px;
    margin: .8rem 0;
    border: 2px solid var(--accent);
    display: inline-block;
    font-family: 'Courier New', monospace;
}

.otp-hint { font-size: .82rem; color: var(--muted); margin-top: .5rem; }

.timer-text {
    color: var(--accent);
    font-weight: 700;
    font-size: .9rem;
    margin-top: .8rem;
    display: block;
}

.timer-text.expired { color: var(--error); }

/* ===== ریسپانسیو ===== */
@media (max-width: 1024px) {
    .panel-visual { padding: 2.5rem 2rem; }
    .panel-form { width: 420px; min-width: 420px; padding: 2.5rem 2.5rem; }
    .visual-title { font-size: 2rem; }
}

@media (max-width: 768px) {
    body { flex-direction: column; }

    .panel-visual {
        flex: none;
        padding: 2rem 1.5rem 1.5rem;
        min-height: auto;
    }

    .logo-circle { width: 80px; height: 80px; margin-bottom: 1rem; }
    .logo-circle img { width: 55px; height: 55px; }
    .visual-title { font-size: 1.6rem; margin-bottom: .3rem; }
    .visual-sub   { font-size: .9rem; margin-bottom: 1.5rem; }
    .features     { display: none; }
    .wave-bottom  { display: none; }

    .panel-form {
        width: 100%;
        min-width: unset;
        padding: 2rem 1.5rem;
        flex: 1;
        border-radius: 24px 24px 0 0;
        margin-top: -20px;
        position: relative;
        z-index: 1;
        box-shadow: 0 -8px 30px rgba(0,0,0,.1);
    }

    .panel-form::before { border-radius: 24px 24px 0 0; }
    .form-header h1 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
    .panel-visual { padding: 1.5rem 1rem 1rem; }
    .panel-form   { padding: 1.8rem 1.2rem; }
    .form-header h1 { font-size: 1.4rem; }
    .captcha-input { max-width: 100%; }
    .form-links { flex-direction: column; align-items: flex-start; }
    .otp-code { font-size: 2rem; letter-spacing: 6px; }
}

/* جلوگیری از zoom در iOS */
@media (max-width: 768px) {
    input, select, textarea { font-size: 16px !important; }
}
