/* ---------- auth pages (login, register, password, e-mail verification, 2FA): dark theme, brand teal ---------- */
:root {
    --au-bg: #16223a;
    --au-surface: #0f172a;
    --au-panel: rgba(128, 145, 178, .05);
    --au-border: #273449;
    --au-text: #e2e8f0;
    --au-muted: #94a3b8;
    --au-brand: #10635e;
    --au-brand-hover: #147a74;
    --au-teal: #2fa89f;
    --au-teal-soft: rgba(16, 99, 94, .22);
    --au-teal-line: rgba(47, 168, 159, .45);
    --au-danger: #ec6a87;
    --au-success: #20b88c;
    --au-radius: 22px;
}
html, body { background: var(--au-bg); color: var(--au-text); }

/* ---------- layout ---------- */
.auth { display: flex; min-height: 100vh; min-height: 100dvh; }
.auth-side {
    position: fixed; inset: 0 auto 0 0; width: 41.6667%; flex-direction: column; overflow: hidden;
    background: radial-gradient(circle at 50% 42%, rgba(16, 99, 94, .55), transparent 55%), radial-gradient(circle at 20% 100%, rgba(16, 99, 94, .35), transparent 50%), var(--au-surface);
}
.auth-main {
    position: relative; margin-left: 41.6667%; flex: 1; min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center; padding: 72px 24px 48px;
    background: linear-gradient(160deg, #1b2a45 0%, #16223a 55%, #131d33 100%); border-left: 1px solid #2f3f5a; overflow: hidden;
}
.auth-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 85% 0%, rgba(47, 168, 159, .30), transparent 50%), radial-gradient(ellipse at 10% 100%, rgba(47, 168, 159, .16), transparent 45%); }
.auth-glow::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 75%); }

/* ---------- card ---------- */
.auth-card {
    position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 36px 36px 30px;
    border: 1px solid var(--au-border); border-radius: var(--au-radius);
    background: linear-gradient(160deg, rgba(16, 99, 94, .14), transparent 45%) var(--au-surface);
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(47, 168, 159, .06);
}
.auth-card::before { content: ""; position: absolute; left: var(--au-radius); right: var(--au-radius); top: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--au-teal), transparent); opacity: .8; }
.auth-card--wide { max-width: 560px; }
.auth-card__brand { display: inline-block; margin-bottom: 26px; }
.auth-card__brand img { height: 2.25rem; width: auto; display: block; }
.auth-head { margin-bottom: 24px; }
.auth-head h1 { color: #fff; font-size: 26px; font-weight: 700; letter-spacing: -.035em; line-height: 1.15; margin: 0; }
.auth-head p { color: var(--au-muted); font-size: 13px; line-height: 1.65; margin: 10px 0 0; }
.auth-head a, .auth-card .auth-link { color: var(--au-teal); font-weight: 600; text-decoration: none; }
.auth-head a:hover, .auth-card .auth-link:hover { color: #5cc7bf; text-decoration: underline; }
.auth-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; margin-bottom: 18px; color: var(--au-teal); background: var(--au-teal-soft); border: 1px solid var(--au-teal-line); font-size: 20px; }

/* ---------- form controls ---------- */
.auth-card .form-label { color: var(--au-text); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.auth-card .form-control, .auth-card .form-select {
    background: rgba(128, 145, 178, .06); border: 1px solid var(--au-border); color: #fff; border-radius: 12px;
    padding: 11px 14px; font-size: 14px; box-shadow: none; transition: border-color .18s, box-shadow .18s, background-color .18s;
}
.auth-card .form-control::placeholder { color: #64748b; }
.auth-card .form-control:focus, .auth-card .form-select:focus { background: rgba(128, 145, 178, .09); border-color: var(--au-teal-line); box-shadow: 0 0 0 3px var(--au-teal-soft); color: #fff; }
.auth-card .form-control:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #15213a inset; -webkit-text-fill-color: #fff; caret-color: #fff; }
.auth-card .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 14px center; background-size: 14px 10px; padding-right: 38px; }
.auth-card .form-select option { background: var(--au-surface); color: var(--au-text); }
.auth-card .form-control-lg { font-size: 22px; letter-spacing: .3em; text-align: center; font-weight: 600; }
.auth-field { margin-bottom: 16px; }
.auth-field__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.auth-field__row .form-label { margin: 0; }
.auth-field__row a { font-size: 12px; color: var(--au-muted); text-decoration: none; }
.auth-field__row a:hover { color: var(--au-teal); }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.auth-grid .auth-field--full { grid-column: 1 / -1; }
.auth-card .text-danger { color: var(--au-danger) !important; font-size: 12px; }
.auth-card .text-danger .form-label { color: var(--au-danger); font-weight: 500; }
.auth-card .text-success { color: var(--au-success) !important; font-size: 13px; }
.auth-card .alert { border-radius: 12px; font-size: 13px; }
.auth-card .alert-danger { background: rgba(236, 106, 135, .12); border: 1px solid rgba(236, 106, 135, .4); color: #fca5a5; }
.auth-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; font-size: 13px; line-height: 1.55; background: rgba(32, 184, 140, .1); border: 1px solid rgba(32, 184, 140, .35); color: #a7f3d0; }
.auth-status i { color: var(--au-success); margin-top: 1px; }

/* ---------- buttons ---------- */
.auth-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 18px; border-radius: 12px;
    font-size: 14px; font-weight: 600; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background-color .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s;
}
.auth-btn--primary { color: #fff; background: linear-gradient(135deg, #147a74, var(--au-brand)); border-color: rgba(47, 168, 159, .35); box-shadow: 0 10px 24px -12px rgba(47, 168, 159, .8); }
.auth-btn--primary:hover { color: #fff; background: linear-gradient(135deg, #1a8f88, #137670); transform: translateY(-1px); box-shadow: 0 14px 26px -12px rgba(47, 168, 159, .9); }
.auth-btn--ghost { color: var(--au-text); background: rgba(128, 145, 178, .06); border-color: var(--au-border); }
.auth-btn--ghost:hover { color: #fff; background: rgba(128, 145, 178, .11); border-color: var(--au-teal-line); }
.auth-btn--ghost img { width: 18px; height: 18px; }
.auth-btn:focus-visible { outline: 2px solid var(--au-teal); outline-offset: 2px; }
.auth-btn + .auth-btn { margin-top: 10px; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--au-muted); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--au-border); }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; font-size: 12px; }
.auth-links a, .auth-links .btn-link { color: var(--au-muted); text-decoration: none; padding: 0; font-size: 12px; border: 0; }
.auth-links a:hover, .auth-links .btn-link:hover { color: var(--au-teal); }

/* ---------- agreement + captcha ---------- */
.auth-agree { display: flex; align-items: flex-start; gap: 9px; margin-top: 20px; font-size: 12px; color: var(--au-muted); line-height: 1.5; }
.auth-agree .form-check-input { flex: none; margin: 1px 0 0; width: 16px; height: 16px; background-color: rgba(128, 145, 178, .08); border: 1px solid var(--au-border); cursor: pointer; }
.auth-agree .form-check-input:checked { background-color: var(--au-brand); border-color: var(--au-brand); }
.auth-agree .form-check-input:focus { box-shadow: 0 0 0 3px var(--au-teal-soft); border-color: var(--au-teal-line); }
.auth-agree label { cursor: pointer; }
.auth-agree a { color: var(--au-teal); text-decoration: none; font-weight: 500; }
.auth-agree a:hover { text-decoration: underline; }
.disable-agreement { position: relative; }
.disable-agreement.active::before { content: ""; position: absolute; z-index: 2; inset: 0; border-radius: 12px; background: rgba(15, 23, 42, .6); cursor: not-allowed; }
.auth-captcha { margin: 4px 0 18px; min-height: 0; }
.g-recaptcha { transform: scale(0.8); transform-origin: 0 0; height: 62px; position: relative; width: 200px; }
.grecaptcha-badge { visibility: hidden !important; }
.alert-errors { position: fixed; bottom: 0; left: 0; }

/* ---------- language switcher ---------- */
.langSwitcherButton { position: fixed; top: 22px; right: 22px; z-index: 3; }
.langSwitcherButton .dropdown-menu { min-width: 9rem; background: var(--au-surface); border: 1px solid var(--au-border); border-radius: 12px; }
.langSwitcherButton .dropdown-item { color: var(--au-text); font-size: 13px; }
.langSwitcherButton .dropdown-item:hover { background: var(--au-teal-soft); color: #fff; }
#langSwitcherButton { box-shadow: none; text-transform: uppercase; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--au-muted); background: rgba(15, 23, 42, .7); border: 1px solid var(--au-border); border-radius: 10px; padding: 7px 12px; backdrop-filter: blur(6px); }
#langSwitcherButton:hover, #langSwitcherButton[aria-expanded="true"] { color: #fff; border-color: var(--au-teal-line); }

/* ---------- left panel: dark navy with the living EDVI core ---------- */
.login-side { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; padding: 40px 48px 44px; color: #cbd5e1; }
.login-side__stage { flex: 1; display: grid; place-items: center; min-height: 0; }
.login-core { position: relative; width: min(400px, 68%); aspect-ratio: 1; display: grid; place-items: center; }
.login-core .bot-core-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.login-core__logo { position: relative; z-index: 1; width: 44%; pointer-events: none; filter: drop-shadow(0 0 22px rgba(47, 168, 159, .6)); animation: login-core-breathe 5.4s ease-in-out infinite; }
.login-core__logo img { width: 100%; height: auto; display: block; }
@keyframes login-core-breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-2px) scale(1.03); } }
.login-core.bot-core--fallback::before { content: ""; position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, #8fd9d2 0%, #2fa89f 35%, transparent 72%); filter: blur(8px); animation: login-core-pulse 3.2s ease-in-out infinite; }
@keyframes login-core-pulse { 0%, 100% { opacity: .55; transform: scale(.94); } 50% { opacity: .9; transform: scale(1.04); } }
.login-side__text { text-align: center; max-width: 380px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.login-side__line { width: 46px; height: 2px; border-radius: 2px; margin-bottom: 16px; background: linear-gradient(90deg, transparent, var(--au-teal), transparent); box-shadow: 0 0 14px rgba(47, 168, 159, .7); }
.login-side__text .login-side__title { color: #fff; font-size: clamp(16px, 1.35vw, 19px); font-weight: 600; letter-spacing: -.02em; line-height: 1.35; margin: 0 0 8px; }
.login-side__text p:not(.login-side__title) { position: relative; color: var(--au-muted); font-size: 12px; line-height: 1.6; margin: 0; letter-spacing: .02em; }
@media (max-width: 1399px) { .login-side { padding: 32px 32px 36px; } }
@media (prefers-reduced-motion: reduce) { .login-core__logo, .login-core.bot-core--fallback::before, .auth-btn--primary:hover { animation: none; transform: none; } }

/* ---------- tablet / phone ---------- */
@media (max-width: 991px) {
    .auth-side { display: none !important; }
    .auth-main { margin-left: 0; border-left: 0; padding: 84px 16px 32px; align-items: flex-start; }
    .auth-card { padding: 28px 22px 24px; }
    .auth-glow { background: radial-gradient(ellipse at 50% 0%, rgba(47, 168, 159, .32), transparent 55%); }
}
@media (max-width: 575px) {
    .auth-main { padding: 76px 12px 24px; }
    .auth-card { padding: 24px 18px 20px; border-radius: 18px; }
    .auth-card::before { left: 18px; right: 18px; }
    .auth-head h1 { font-size: 22px; }
    .auth-grid { grid-template-columns: 1fr; gap: 0; }
    .langSwitcherButton { top: 16px; right: 12px; }
}
