/* Obsidian Precision theme overrides */
:root{
  /* Palette (matches provided tokens) */
  --obs-surface: #0b1326;
  --obs-surface-dim: #0b1326;
  --obs-surface-bright: #31394d;
  --obs-surface-container: #171f33;
  --obs-surface-container-high: #222a3d;
  --obs-surface-container-highest: #2d3449;
  --obs-on-surface: #dae2fd;
  --obs-on-surface-variant: #c7c4d7;
  --obs-outline: #908fa0;
  --obs-primary: #8083ff; /* refined indigo */
  --obs-primary-container: #6f71ff;
  --obs-secondary: #b9c8de;
  --obs-tertiary: #bcc7de;
  --obs-error: #ffb4ab;

  /* Spacing & radii */
  --g-unit: 4px;
  --g-xs: 4px;
  --g-sm: 8px;
  --g-md: 16px;
  --g-lg: 24px;
  --g-xl: 40px;
  --g-container-max: 1280px;
  --r-sm: 2px;
  --r: 4px;
  --r-md: 6px;
  --r-lg: 8px;

  /* Type sizes (respect existing fonts per user request) */
  --display-lg: 48px;
  --headline-lg: 32px;
  --headline-md: 24px;
  --body-lg: 18px;
  --body-md: 16px;
  --label-md: 14px;
  --label-sm: 12px;
}

/* Apply subtle tonal background and keep body font as-is */
html,body{background: linear-gradient(180deg,var(--obs-surface) 0%, var(--obs-surface-container) 100%);color:var(--obs-on-surface)}

/* Header refinement */
.header{padding:12px var(--g-lg);border-bottom:1px solid rgba(144,143,160,0.12);background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent)}
.header-logo{font-size:var(--headline-lg);font-weight:600;color:var(--obs-on-surface);letter-spacing:-0.01em}

/* Constrain main container using fixed-fluid hybrid grid */
.main-container{width:100%;max-width:var(--g-container-max);padding:0 var(--g-lg);box-sizing:border-box;margin:56px auto}

/* Footer adjustments */
.footer{background:var(--obs-surface-container);border-top:1px solid rgba(144,143,160,0.08);color:var(--obs-on-surface-variant);padding-bottom:20px}
.footer-container{padding-bottom: 20px;margin:0 auto;display:flex;flex-wrap:wrap;}

/* Buttons */
.btn-main,
.btn-primary,
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  width: 100%;
  background: var(--obs-primary);
  color: #ffffff;
  border-radius: var(--r);
  padding: 10px 14px;
  border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-main:hover,
.btn-primary:hover,
.btn-submit:hover {
  background: #6f71ff;
  box-shadow: 0 0 12px rgba(77,77,255,0.14);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  background: rgba(128,131,255,0.08);
  color: var(--obs-on-surface);
  border: 1px solid rgba(144,143,160,0.14);
  border-radius: var(--r);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(128,131,255,0.16);
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  background: rgba(11,19,38,0.6);
  border: 1px solid rgba(144,143,160,0.06);
  color: var(--obs-on-surface);
  border-radius: var(--r);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: rgba(11,19,38,0.8);
  border-color: rgba(144,143,160,0.12);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  background: transparent;
  color: var(--obs-primary);
  border: 1px solid rgba(77,77,255,0.4);
  border-radius: var(--r);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: rgba(77,77,255,0.12);
}

.btn-back,
.btn-toggle-password {
  transition: all 0.2s ease;
}

.btn-back {
  background: rgba(255,255,255,0.04);
  color: var(--obs-on-surface);
  border: 1px solid rgba(144,143,160,0.12);
}

.btn-back:hover {
  background: rgba(255,255,255,0.08);
}

.btn-toggle-password {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(144,143,160,0.16);
  color: var(--obs-on-surface);
}

.btn-toggle-password:hover {
  background: rgba(255,255,255,0.08);
}

/* Light theme */
html.light-theme{
  --obs-surface: #f8fbff;
  --obs-surface-dim: #eef3f9;
  --obs-surface-bright: #ffffff;
  --obs-surface-container: #f2f6fc;
  --obs-surface-container-high: #ffffff;
  --obs-surface-container-highest: #edf1f9;
  --obs-on-surface: #0f172a;
  --obs-on-surface-variant: #475569;
  --obs-outline: #94a3b8;
  --obs-primary: #3a48db;
  --obs-primary-container: #dfe3ff;
  --obs-secondary: #64748b;
  --obs-tertiary: #475569;
  --obs-error: #b91c1c;
  --obs-surface-border: rgba(15,23,42,0.08);
  --obs-link: #b45309;
  --obs-link-hover: #c2410c;
}

html.light-theme body{
  background: linear-gradient(180deg, var(--obs-surface) 0%, var(--obs-surface-container) 100%);
  color: var(--obs-on-surface);
}

html.light-theme .header{
  border-bottom-color: rgba(15,23,42,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.88), transparent);
}

html.light-theme .theme-toggle{
  border-color: rgba(15,23,42,0.12);
  color: var(--obs-on-surface);
}

html.light-theme .theme-toggle:hover{
  background: rgba(15,23,42,0.04);
  border-color: rgba(15,23,42,0.18);
}

html.light-theme input[type="text"],
html.light-theme input[type="email"],
html.light-theme input[type="password"],
html.light-theme textarea,
html.light-theme select {
  background: rgba(255,255,255,0.94);
  border-color: var(--obs-surface-border);
  color: var(--obs-on-surface);
}

html.light-theme input:focus,
html.light-theme textarea:focus,
html.light-theme select:focus {
  border-color: var(--obs-primary);
  box-shadow: 0 0 12px rgba(58,72,219,0.18);
}

html.light-theme .card,
html.light-theme .auth-card,
html.light-theme .dashboard-support-block,
html.light-theme .instruction-step,
html.light-theme .cookie-banner {
  background: var(--obs-surface-container-high);
  border-color: var(--obs-surface-border);
  color: var(--obs-on-surface);
}

html.light-theme .footer{
  background: var(--obs-surface-container);
  border-top-color: var(--obs-surface-border);
  color: var(--obs-on-surface-variant);
}

html.light-theme .footer-link,
html.light-theme .support-link {
  color: var(--obs-link);
}

html.light-theme .footer-link:hover,
html.light-theme .support-link:hover {
  color: var(--obs-link-hover);
}

html.light-theme .platform-tab {
  background: rgba(58,72,219,0.08);
  border-color: rgba(58,72,219,0.16);
  color: var(--obs-on-surface);
}

html.light-theme .platform-tab.active {
  background: rgba(58,72,219,0.16);
  border-color: rgba(58,72,219,0.24);
}

html.light-theme .instruction-step {
  background: rgba(71,85,105,0.06);
  border-color: rgba(71,85,105,0.12);
}

html.light-theme .btn-main,
html.light-theme .btn-primary,
html.light-theme .btn-submit {
  background: var(--obs-primary-container);
  color: var(--obs-primary);
  border-color: rgba(58,72,219,0.18);
}

html.light-theme .btn-main:hover,
html.light-theme .btn-primary:hover,
html.light-theme .btn-submit:hover {
  background: var(--obs-primary);
  color: #ffffff;
}

html.light-theme .btn-secondary {
  background: var(--obs-surface-container-high);
  border-color: rgba(15,23,42,0.12);
  color: var(--obs-on-surface);
}

html.light-theme .btn-secondary:hover {
  background: var(--obs-surface-container-highest);
}

html.light-theme .btn-copy {
  background: rgba(58,72,219,0.08);
  border-color: rgba(58,72,219,0.16);
  color: var(--obs-on-surface);
}

html.light-theme .btn-copy:hover {
  background: rgba(58,72,219,0.16);
}

html.light-theme .btn-outline {
  color: var(--obs-primary);
  border-color: var(--obs-primary);
  background: rgba(58,72,219,0.06);
}

html.light-theme .btn-outline:hover {
  background: rgba(58,72,219,0.12);
}

html.light-theme .btn-back {
  background: var(--obs-surface-container-high);
  color: var(--obs-on-surface);
  border-color: rgba(15,23,42,0.12);
}

html.light-theme .btn-back:hover {
  background: var(--obs-surface-container-highest);
}

html.light-theme .btn-toggle-password {
  background: rgba(15,23,42,0.04);
  border-color: rgba(15,23,42,0.15);
  color: var(--obs-on-surface);
}

html.light-theme .btn-toggle-password:hover {
  background: rgba(15,23,42,0.08);
}

html.light-theme .cookie-banner {
  background: rgba(255,255,255,0.98);
  border: 1px solid var(--obs-surface-border);
  color: var(--obs-on-surface);
}

html.light-theme a:not(.btn):not(.btn-primary):not(.btn-outline):not(.btn-submit):not(.btn-back):not(.btn-secondary):not(.btn-copy) {
  color: var(--obs-link);
}


/* Inputs: recessed look with 1px border and focus glow */
input,textarea,select{background:transparent;border-radius:var(--r);color:var(--obs-on-surface);font-size:var(--body-md);font-family:"YandexRegular", var(--font-body)}
input[type="text"],input[type="email"],input[type="password"],textarea{background:rgba(255,255,255,0.01);border:1px solid rgba(144,143,160,0.06);padding:8px 10px}
input:focus,textarea:focus{outline:none;border-color:var(--obs-primary);box-shadow:0 0 8px rgba(128,131,255,0.12)}

/* Links: keep them yellow and without underline */
a:not(.btn):not(.btn-primary):not(.btn-outline):not(.btn-submit):not(.btn-back):not(.btn-secondary):not(.btn-copy){color:#fbbf24;text-decoration:none}
a:not(.btn):not(.btn-primary):not(.btn-outline):not(.btn-submit):not(.btn-back):not(.btn-secondary):not(.btn-copy):hover,a:not(.btn):not(.btn-primary):not(.btn-outline):not(.btn-submit):not(.btn-back):not(.btn-secondary):not(.btn-copy):focus{color:#fbbf24;text-decoration:none}

/* Cards: tonal tier and thin border, optional top accent */
.card{background:var(--obs-surface-container-high);border:1px solid rgba(144,143,160,0.06);border-radius:var(--r-lg);padding:16px}
.card.featured{border-top:2px solid rgba(128,131,255,0.12)}

/* Chips/tags */
.chip{font-family:inherit;font-size:var(--label-sm);padding:4px 8px;border-radius:var(--r);background:rgba(128,131,255,0.08);color:var(--obs-on-surface)}

/* Lists: subtle dividers and hover tonal shift */
.list-item{border-bottom:1px solid rgba(144,143,160,0.04);padding:12px 8px}
.list-item:hover{background:rgba(255,255,255,0.02)}

/* Modal/backdrop hints */
.modal-backdrop{backdrop-filter:blur(12px);background:rgba(11,19,38,0.45)}

/* Small utility alignment for form cards */
.auth-card{max-width:520px;width:100%;background:var(--obs-surface-container-high);border-radius:var(--r-lg);padding:24px;box-shadow:none}
.auth-title{font-size:20px;color:var(--obs-on-surface-variant)}
.btn-submit{border-radius:var(--r);padding:10px 14px}

/* Typography tweaks while keeping existing Yandex fonts */
.yandex-thin{font-family: "YandexThin", var(--font-body);}
h1,h2,h3{color:var(--obs-on-surface);margin:0 0 8px}

/* Accessible focus outlines for keyboard users */
button:focus, a:focus, input:focus{outline:2px solid rgba(192,193,255,0.12);outline-offset:2px}

/* Responsive gutters */
@media (max-width:700px){.main-container{padding:0 16px;margin-top:32px}.footer-container{padding-bottom: 20px}}

/* Keep scrollbars thin and tonal */
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-thumb{background:rgba(192,193,255,0.12);border-radius:8px}

/* Ensure cookie banner matches theme */
.cookie-banner{background:rgba(6,14,32,0.96);color:var(--obs-on-surface)}
