/* =========================================================
   AUTH.CSS — МОДУЛЬ АВТОРИЗАЦИИ, РЕГИСТРАЦИИ И СБРОСА ПАРОЛЯ
   ========================================================= */

#sk-auth-modal .sk-modal-box {
    max-width: 420px;
    padding: 30px;
}

/* Ошибки валидации */
.sk-form-error {
    background: rgba(255, 75, 75, 0.1);
    border: 1px solid rgba(255, 75, 75, 0.4);
    border-radius: var(--radius-lg, 10px);
    padding: 10px 14px;
    margin-bottom: 15px;
    color: #ff5555;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.sk-form-error:empty {
    display: none;
}

/* Вкладки: Вход / Регистрация / Восстановление */
.sk-modal-tabs {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sk-modal-tab {
    padding: 5px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted, #8b949e);
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    font-family: inherit;
}

.sk-modal-tab:hover {
    color: var(--accent-hover, #ffffff);
}

.sk-modal-tab.is-active {
    color: var(--accent-cyan, #00d2ff);
}

.sk-modal-tab.is-active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-cyan, #00d2ff);
    border-radius: 2px;
}

.sk-auth-form-block label {
    display: block;
    color: var(--text-muted, #8b949e);
    font-size: 13px;
    margin-bottom: 6px;
}

/* Поля ввода авторизации с иконками */
.sk-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.sk-input-wrapper input,
.sk-input-wrapper select {
    width: 100%;
    background: var(--bg-main, #0d1117);
    border: 1px solid var(--border-color, #30363d);
    border-radius: var(--radius-md, 6px);
    padding: 12px 45px 12px 40px;
    color: var(--accent-hover, #ffffff);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.sk-input-wrapper input:focus,
.sk-input-wrapper select:focus {
    border-color: var(--accent-cyan, #00d2ff);
    box-shadow: 0 0 15px var(--accent-cyan-glow-low);
}

.sk-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #8b949e);
    font-size: 16px;
    pointer-events: none;
}

/* Кнопка показать/скрыть пароль (глаз) */
.toggle-password-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted, #8b949e);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2;
    padding: 0;
    line-height: 1;
}

.toggle-password-btn:hover {
    color: var(--accent-cyan, #00d2ff);
}

.sk-modal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 20px;
    color: var(--text-muted, #8b949e);
}

.sk-modal-meta a {
    color: var(--accent-cyan, #00d2ff);
    text-decoration: none;
}

.sk-modal-meta a:hover {
    text-decoration: underline;
}

.sk-form-notice {
    font-size: 12px;
    color: var(--text-muted, #8b949e);
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Основная кнопка отправки формы */
.sk-modal-btn {
    width: 100%;
    background: var(--accent-cyan, #00d2ff);
    border: 1px solid var(--accent-cyan, #00d2ff);
    color: var(--bg-main, #0d1117);
    padding: 12px;
    border-radius: var(--radius-md, 6px);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
    font-size: 14px;
}

.sk-modal-btn:hover {
    background: var(--accent-hover, #ffffff);
    border-color: var(--accent-hover, #ffffff);
    box-shadow: 0 0 16px rgba(0, 210, 255, 0.4);
}

.sk-modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sk-modal-success {
    text-align: center;
    padding: 20px 0;
}

.sk-modal-success-title {
    font-size: 20px;
    color: var(--accent-cyan, #00d2ff);
    font-weight: bold;
    margin-bottom: 10px;
}

.sk-modal-success-text {
    color: var(--text-main, #e6edf3);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.sk-auth-form-block {
    display: none;
}

.sk-auth-form-block.is-active {
    display: block;
}

/* Блок секретного вопроса */
#sk-reset-question {
    background: rgba(0, 210, 255, 0.05);
    border: 1px solid var(--accent-cyan-glow-low);
    border-radius: var(--radius-lg, 10px);
    padding: 12px 14px;
    margin-bottom: 15px;
    position: relative;
}

#sk-reset-question label {
    display: block;
    color: var(--accent-cyan, #00d2ff);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

#sk-reset-question .sk-input-wrapper {
    margin-bottom: 0;
}

/* Индикатор сложности пароля */
.password-strength-inside {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    overflow: hidden;
    border-radius: 0 0 var(--radius-md, 6px) var(--radius-md, 6px);
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    background: transparent;
    border-radius: 0 0 var(--radius-md, 6px) var(--radius-md, 6px);
    transition: width 0.3s ease, background 0.3s ease;
}

/* Auth UX: scoped to the existing modal and guest entry buttons. */
#sk-auth-modal[hidden], #sk-auth-modal [hidden] { display:none !important; }
#sk-auth-modal { padding:24px; }
#sk-auth-modal .sk-modal-box { width:480px; max-width:100% !important; padding:0 !important; max-height:calc(100vh - 48px); max-height:calc(100dvh - 48px); display:flex; flex-direction:column; overflow:hidden; transform:none; }
#sk-auth-modal, #sk-auth-modal * { box-sizing:border-box; }
#sk-auth-modal[data-auth-view="register"] .sk-modal-box { width:640px; }
#sk-auth-modal .sk-auth-head { display:flex; gap:14px; align-items:center; padding:16px 20px; flex-shrink:0; border-bottom:1px solid var(--border-color,#30363d); background:rgba(0,210,255,.045); }
#sk-auth-modal .sk-auth-head > div { flex:1; min-width:0; }
#sk-auth-modal .sk-auth-head h2 { margin:0; color:#fff; font-size:18px; line-height:1.35; }
#sk-auth-modal .sk-auth-head p { margin:4px 0 0; color:#aab5c3; font-size:14px; line-height:1.45; }
#sk-auth-modal .sk-auth-head-icon { display:grid; place-items:center; width:40px; height:40px; flex:0 0 40px; color:#00d2ff; background:rgba(0,210,255,.09); border:1px solid rgba(0,210,255,.3); border-radius:10px; }
#sk-auth-modal .sk-modal-close { position:static; transform:none; flex:0 0 44px; width:44px; height:44px; display:grid; place-items:center; border:1px solid #30363d; border-radius:10px; font-size:16px; padding:0; color:#bac4cf; }
#sk-auth-modal .sk-modal-close:hover { color:#fff; background:rgba(255,255,255,.04); transform:none; }
#sk-auth-modal .sk-modal-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; margin:0; padding:12px 20px 0; flex-shrink:0; border:0; }
#sk-auth-modal .sk-modal-tab { display:flex; align-items:center; justify-content:center; gap:7px; padding:10px 4px; min-height:44px; border:1px solid transparent; border-radius:10px; font-size:14px; color:#aab5c3; }
#sk-auth-modal .sk-modal-tab i { display:none; }
#sk-auth-modal .sk-modal-tab.is-active { color:#00d2ff; background:rgba(0,210,255,.09); border-color:rgba(0,210,255,.5); }
#sk-auth-modal .sk-modal-tab.is-active::after { display:none; }
#sk-auth-modal .sk-modal-body-container { padding:16px 20px; overflow-y:auto; min-height:0; overscroll-behavior:contain; }
#sk-auth-modal .sk-auth-form-block { margin:0; }
#sk-auth-modal form { margin:0; }
#sk-auth-modal .sk-auth-field { display:flex; flex-direction:column; gap:6px; margin:0 0 12px; color:#c5cdd7; font-size:14px; }
#sk-auth-modal .sk-auth-field > span:first-child { color:#c5cdd7; font-weight:600; }
#sk-auth-modal .sk-input-wrapper { display:block; margin:0; position:relative; }
#sk-auth-modal .sk-input-wrapper input, #sk-auth-modal .sk-input-wrapper select { min-height:44px; padding:10px 48px 10px 40px; font-size:16px; font-family:var(--font-main,Arial,sans-serif); color:#e6edf3; border-radius:10px; color-scheme:dark; }
#sk-auth-modal .sk-input-wrapper select { padding-right:12px; }
#sk-auth-modal .sk-input-icon { color:#8e9baa; font-size:15px; left:13px; }
#sk-auth-modal .toggle-password-btn { top:0; right:2px; transform:none; height:44px; width:44px; display:grid; place-items:center; font-size:16px; }
#sk-auth-modal .sk-auth-field small, #sk-auth-modal .sk-form-notice { font-size:14px; line-height:1.45; color:#aab5c3; margin:0; }
#sk-auth-modal .sk-auth-group { border:0; margin:0; padding:0; min-width:0; }
#sk-auth-modal .sk-auth-group + .sk-auth-group { margin-top:16px; padding-top:12px; border-top:1px solid #30363d; }
#sk-auth-modal .sk-auth-group h3 { padding:0; margin:0 0 8px; line-height:1.4; color:#00d2ff; font-size:14px; font-weight:700; }
#sk-auth-modal .sk-auth-group > .sk-form-notice:first-of-type { margin-bottom:12px; }
#sk-auth-modal .sk-auth-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#sk-auth-modal .sk-auth-warning { padding:10px 12px; border-radius:10px; background:rgba(255,123,0,.06); border:1px solid rgba(255,123,0,.22); color:#e6bd92; }
#sk-auth-modal .sk-auth-honeypot { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
#sk-auth-modal .sk-modal-meta { margin:2px 0 0; gap:12px; flex-wrap:wrap; font-size:14px; }
#sk-auth-modal .sk-auth-remember { display:inline-flex; align-items:center; gap:8px; margin:0; min-height:44px; color:#c5cdd7; font-size:14px; cursor:pointer; }
#sk-auth-modal .sk-auth-remember input { width:18px; height:18px; margin:0; accent-color:#00d2ff; }
#sk-auth-modal #forgot-password-link { display:inline-flex; align-items:center; min-height:44px; }
#sk-auth-modal .sk-auth-foot { flex-shrink:0; padding:12px 20px; border-top:1px solid #30363d; background:#0d1117; }
#sk-auth-modal .sk-modal-btn { display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:10px 14px; font-size:14px; border-radius:10px; box-shadow:none; }
#sk-auth-modal .sk-modal-btn:hover { background:#39ddff; border-color:#39ddff; box-shadow:none; }
#sk-auth-modal .sk-modal-btn:disabled { cursor:wait; }
#sk-auth-modal .sk-form-error { color:#ffb7bf; background:rgba(255,77,94,.1); border-color:rgba(255,77,94,.25); font-size:14px; line-height:1.45; margin:0 0 12px; }
#sk-auth-modal .sk-auth-status { margin:0 0 12px; padding:10px 12px; color:#b9eaf6; background:rgba(0,210,255,.06); border-radius:8px; font-size:14px; line-height:1.45; }
#sk-auth-modal .sk-auth-text-btn { border:0; background:none; color:#00d2ff; padding:8px 0; min-height:44px; font:inherit; font-size:14px; cursor:pointer; text-align:left; }
#sk-auth-modal #sk-reset-question { padding:0; margin:16px 0 0; border:0; background:none; }
#sk-auth-modal #sk-reset-question .sk-auth-field { margin-bottom:14px; color:#c5cdd7; font-weight:400; }
#sk-auth-modal #sk-reset-question-text { color:#00d2ff; font-size:14px; }
#sk-auth-modal .cf-turnstile { margin-top:12px; min-height:65px; }
#sk-auth-modal .sk-modal-success { text-align:center; padding:20px 0; }
#sk-auth-modal .sk-auth-success-icon { display:grid; place-items:center; margin:0 auto 16px; width:56px; height:56px; border:1px solid rgba(0,210,255,.3); border-radius:50%; background:rgba(0,210,255,.08); color:#00d2ff; font-size:24px; }
#sk-auth-modal .sk-modal-success-title { margin:0 0 10px; font-size:20px; }
#sk-auth-modal .sk-modal-success-text { margin:0; font-size:14px; }
#sk-auth-modal :is(button,a,input,select):focus-visible { outline:2px solid #79e7ff; outline-offset:2px; }
#sk-auth-modal input:focus, #sk-auth-modal select:focus { box-shadow:none; }
/* Guest entry buttons retain the theme's original pill styling. */
@media(max-width:520px) {
 #sk-auth-modal { padding:12px; }
 #sk-auth-modal .sk-modal-box { max-height:calc(100vh - 24px); max-height:calc(100dvh - 24px); }
 #sk-auth-modal .sk-auth-head, #sk-auth-modal .sk-modal-body-container { padding:16px; }
 #sk-auth-modal .sk-auth-foot { padding:12px 16px; }
 #sk-auth-modal .sk-modal-tabs { padding:14px 16px 0; gap:6px; }
 #sk-auth-modal .sk-modal-tab i { display:none; }
 #sk-auth-modal .sk-modal-tab { padding:10px 5px; font-size:14px; }
 #sk-auth-modal .sk-auth-pair { grid-template-columns:1fr; gap:0; }
}
@media(prefers-reduced-motion:reduce) { #sk-auth-modal, #sk-auth-modal .sk-modal-box { transition:none; } }
/* Keep the standard security widget readable on narrow phones, without scaling. */
@media(max-width:360px) {
 #sk-auth-modal { padding:8px; }
 #sk-auth-modal .sk-modal-box { max-height:calc(100vh - 16px); max-height:calc(100dvh - 16px); }
 #sk-auth-modal .sk-modal-tabs { padding-left:8px; padding-right:8px; gap:4px; }
 #sk-auth-modal .sk-modal-tab { padding-left:2px; padding-right:2px; }
 #sk-auth-modal .cf-turnstile { width:calc(100% + 32px); margin-left:-16px; }
}

#sk-auth-modal .sk-auth-tab-short { display:none; }
@media(max-width:360px) {
 #sk-auth-modal .sk-auth-tab-long { display:none; }
 #sk-auth-modal .sk-auth-tab-short { display:inline; }
}

/* SIDEKICK ID: existing auth flows, themed header and per-view accents. */

#sk-auth-modal { --auth-accent:#00d2ff; --auth-rgb:0,210,255; }
#sk-auth-modal[data-auth-view="register"] { --auth-accent:#ff9b3e; --auth-rgb:255,155,62; }
#sk-auth-modal .sk-modal-box { border-color:rgba(var(--auth-rgb),.34); box-shadow:0 20px 70px rgba(0,0,0,.48); }
#sk-auth-modal .sk-auth-head { position:relative; padding:16px 20px; gap:16px; background:radial-gradient(ellipse at 0 0,rgba(var(--auth-rgb),.13),transparent 75%),#111820; border-bottom:1px solid rgba(var(--auth-rgb),.16); }
#sk-auth-modal .sk-auth-head::after { content:""; position:absolute; height:2px; bottom:-1px; left:20px; right:20px; background:linear-gradient(90deg,var(--auth-accent),rgba(var(--auth-rgb),.25) 55%,transparent); box-shadow:0 2px 12px rgba(var(--auth-rgb),.14); pointer-events:none; }
#sk-auth-modal .sk-auth-head-icon { width:56px; height:56px; flex-basis:56px; padding:4px; border-radius:50%; background:#090f15; border-color:rgba(var(--auth-rgb),.48); box-shadow:0 0 20px rgba(var(--auth-rgb),.11); }
#sk-auth-modal .sk-auth-head-icon img { display:block; width:46px; height:46px; object-fit:contain; }
#sk-auth-modal .sk-auth-head-icon i { display:none; }
#sk-auth-modal .sk-auth-id { display:block; margin:0 0 4px; font-family:Consolas,monospace; font-size:14px; line-height:1.3; letter-spacing:1.8px; color:var(--auth-accent); }
#sk-auth-modal .sk-auth-head h2 { font-size:22px; line-height:1.3; }
#sk-auth-modal .sk-auth-head p { margin-top:4px; }
#sk-auth-modal .sk-modal-tab.is-active { color:var(--auth-accent); border-color:rgba(var(--auth-rgb),.5); background:rgba(var(--auth-rgb),.09); }
#sk-auth-modal .sk-auth-group h3 { color:var(--auth-accent); }
#sk-auth-modal .sk-auth-warning { color:#b7c2cf; background:rgba(255,255,255,.025); border-color:#303b45; }
#sk-auth-modal .sk-modal-btn { background:var(--auth-accent); border-color:var(--auth-accent); color:#091118; box-shadow:0 0 20px rgba(var(--auth-rgb),.12); }
#sk-auth-modal .sk-modal-btn:hover { background:var(--auth-accent); border-color:var(--auth-accent); filter:brightness(1.06); }
#sk-auth-modal :is(button,a,input,select):focus-visible { outline-color:var(--auth-accent); }
#sk-auth-modal input:focus, #sk-auth-modal select:focus { border-color:var(--auth-accent); }
@media(max-width:520px) {
 #sk-auth-modal .sk-auth-head { padding:16px; gap:12px; }
 #sk-auth-modal .sk-auth-head::after { left:16px; right:16px; }
 #sk-auth-modal .sk-auth-head-icon { width:48px; height:48px; flex-basis:48px; }
 #sk-auth-modal .sk-auth-head-icon img { width:38px; height:38px; }
 #sk-auth-modal .sk-auth-head h2 { font-size:20px; }
}

@media(min-width:521px) { #sk-auth-modal .sk-modal-body-container { padding-top:12px; padding-bottom:12px; } }
#sk-auth-modal .sk-auth-success-icon { color:var(--auth-accent); border-color:rgba(var(--auth-rgb),.3); background:rgba(var(--auth-rgb),.08); }
#sk-auth-modal .sk-modal-success-title { color:var(--auth-accent); }


/* Одна рамка активного поля, без второго контура и свечения */
#sk-auth-modal .sk-input-wrapper :is(input, select):is(:focus, :focus-visible) {
    border-color: var(--auth-accent);
    outline: none;
    box-shadow: none;
}