/* ============================================================
   LOGIN PAGES — token-driven (css/theme-tokens.blade.php)
   Shared by /admin/login, /country/login, /region/login,
   /bd/login. Light/dark come from the same tokens as the panel;
   the accent (#FF9428) is a touch (button / focus / links), not
   a wash. RTL handled with logical properties.
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
}

/* Subtle ambient accents — quiet, static, no giant circles */
.bg-animation {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    opacity: .5;
}

.shape1 { width: 420px; height: 420px; top: -160px; inset-inline-end: -140px; }
.shape2 { width: 340px; height: 340px; bottom: -140px; inset-inline-start: -120px; }
.shape3 { display: none; }

/* Theme toggle (styled by theme-tokens; positioned here for login) */
.login-body #theme-toggle-btn {
    position: fixed;
    top: 18px;
    inset-inline-end: 18px;
    margin: 0;
    z-index: 10;
}

.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    width: min(1000px, 94vw);
    min-height: 600px;
}

/* ---------- Branding side: mirrors the panel sidebar (neutral slate) ---------- */
.branding-side {
    flex: 1;
    background: var(--sidebar-bg);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--sidebar-text);
    position: relative;
    overflow: hidden;
    border-inline-end: 1px solid var(--border);
}

.branding-side::after {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, transparent, var(--accent), transparent);
    opacity: .55;
}

.logo-container { text-align: center; position: relative; z-index: 1; }

.logo-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .35));
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; }

.brand-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--sidebar-text-strong);
}

.brand-subtitle {
    font-size: 15px;
    line-height: 1.7;
    max-width: 320px;
    text-align: center;
    color: var(--sidebar-text);
}

.features {
    margin-top: 44px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 340px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--sidebar-hover);
    border: 1px solid var(--sidebar-border);
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 14px;
    transition: background .2s ease, border-color .2s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .14);
    color: var(--sidebar-text-strong);
}

.feature-icon { font-size: 20px; }

/* ---------- Form side ---------- */
.form-side {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
}

.form-header { margin-bottom: 32px; }
.form-title { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.form-subtitle { color: var(--text-secondary); font-size: 15px; }

.form-group { margin-bottom: 22px; }

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.input-wrapper { position: relative; }

.input-icon {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
    line-height: 1;
}

.form-input {
    width: 100%;
    padding-block: 14px;
    padding-inline-start: 48px;
    padding-inline-end: 48px;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
    /* colors (bg / text / border / focus ring) come from theme-tokens */
}

.password-toggle {
    position: absolute;
    inset-inline-end: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
}
.password-toggle:hover { color: var(--accent); }

.error-text { margin-top: 8px; color: var(--danger); font-size: 13px; }

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 400;
}
.checkbox-wrapper input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--accent);
}

.forgot-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color .2s ease;
}
.forgot-link:hover { color: var(--accent-strong); text-decoration: underline; }

.login-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: var(--accent-contrast);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.login-btn:hover { background: var(--accent-strong); }
.login-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.login-btn:disabled { opacity: .65; cursor: not-allowed; }

.btn-arrow { line-height: 1; }
[dir="rtl"] .btn-arrow { transform: scaleX(-1); }

.divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 28px 0;
    color: var(--text-muted);
    font-size: 14px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.language-selector {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 8px 18px;
    border: 1px solid var(--border-strong);
    background: transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: all .2s ease;
}
.lang-btn.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}
.lang-btn:hover:not(.active) {
    border-color: var(--text-muted);
    background: var(--surface-raised);
    color: var(--text-primary);
}

.reset-link { text-align: center; margin-top: 16px; }
.reset-link a { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; }
.reset-link a:hover { text-decoration: underline; }

.alert {
    padding: 12px 16px;
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--warning);
    font-size: 14px;
}

.rights {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 968px) {
    .login-container { flex-direction: column; width: min(620px, 94vw); min-height: 0; }
    .branding-side { padding: 36px 28px; border-inline-end: none; border-bottom: 1px solid var(--border); }
    .branding-side::after { inset-inline-start: 0; top: auto; bottom: 0; width: 100%; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
    .features { margin-top: 26px; }
    .logo-icon { width: 90px; height: 90px; margin-bottom: 18px; }
    .brand-title { font-size: 26px; }
    .form-side { padding: 36px 28px; }
}

@media (max-width: 640px) {
    body.login-body { padding: 16px 12px; }
    .login-container { border-radius: 16px; }
    .form-side, .branding-side { padding: 28px 20px; }
    .form-title { font-size: 24px; }
    .features { display: none; }
    .form-options { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 420px) {
    .logo-icon { width: 76px; height: 76px; }
    .brand-title { font-size: 22px; }
    .brand-subtitle { font-size: 14px; }
    .form-title { font-size: 22px; }
    .form-input { font-size: 14px; }
    .login-btn { padding: 13px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
