/* ============================================================
   Финтех в Яндексе — auth-service theme
   Derived from the design-system tokens (colors_and_type.css),
   scaled down for web/product UI. Source: Финтех_шаблон_с_гайдом.pptx
   ============================================================ */

/* ---------- FONTS ----------
   Coil = brand display face (headings = Medium). YS Text = dense product UI
   (forms, tables, fine print). Coil Medium loads from desktop OTF — the web
   kit ships only Light/Regular as woff2 (flagged substitution). */
@font-face {
  font-family: 'Coil';
  src: url('/assets/fonts/Coil-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Coil';
  src: url('/assets/fonts/Coil-Medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'YS Text';
  src: url('/assets/fonts/YS-Text-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'YS Text';
  src: url('/assets/fonts/YS-Text-Medium.ttf') format('truetype');
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  /* ---- palette (theme1.xml) ---- */
  --ink:         #020205;
  --white:       #FFFFFF;
  --graphite:    #2F3033;
  --lavender-bg: #F1EBF6;
  --lilac-100:   #E8E8FF;   /* default plate fill            */
  --lilac-200:   #E1CFFF;
  --lilac-300:   #D8D0E5;
  --purple:      #844EDC;   /* PRIMARY brand accent          */
  --magenta:     #C62CD0;
  --orange:      #FF9A00;
  --slate-500:   #4D5566;   /* secondary text                */
  --slate-400:   #8F96A5;   /* tertiary / captions           */
  --slate-300:   #AAAAAA;
  --mist:        #E3E8E8;   /* cool fill — table rows         */

  /* ---- semantic ---- */
  --bg:        var(--white);
  --fg:        var(--ink);
  --fg-2:      var(--slate-500);
  --fg-3:      var(--slate-400);
  --brand:     var(--purple);
  --brand-ink: #6A3CC0;     /* purple text/hover (darker)     */
  --plate:     var(--lilac-100);
  --hairline:  rgba(2, 2, 5, 0.10);
  --field-bd:  rgba(2, 2, 5, 0.14);
  --ok:        #1F8A4C;
  --ok-bg:     #E5F4EB;
  --err:       #C0341D;
  --err-bg:    #FBE9E6;

  /* ---- type ---- */
  --font-display: 'Coil', 'YS Text', system-ui, sans-serif;
  --font-ui:      'YS Text', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* ---- grid / spacing (web scale) ---- */
  --unit: 30px;             /* one grid square — plate radius unit */
  --radius-plate: 30px;     /* 1 square */
  --radius-field: 14px;
  --radius-pill:  999px;
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  /* ---- elevation ---- the system is flat; soft shadow only for the floating
     auth card / menus, per the brand's product-UI exception. */
  --shadow-card: 0 18px 50px rgba(47, 48, 51, 0.10);
}

/* ============ RESET / BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
  background:
    radial-gradient(1100px 520px at 85% -10%, #EDEAF7 0%, rgba(237, 234, 247, 0) 60%),
    radial-gradient(900px 480px at -10% 110%, #F3EAF8 0%, rgba(243, 234, 248, 0) 55%),
    var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ APP SHELL ============ */
.brandbar {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(1.1) blur(8px);
}
.brandbar__mark { height: 18px; width: auto; display: block; }

.shell {
  width: 100%;
  max-width: 27rem;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-7);
}
.shell--wide { max-width: 46rem; }

/* ============ TYPE ============ */
.h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin: 0;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0;
}
.lead   { font-size: 16px; color: var(--fg-2); margin: var(--space-2) 0 0; }
.muted  { color: var(--fg-3); }
.caption { font-size: 13px; color: var(--fg-3); }

/* ============ LOGIN HERO ============ */
.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.hero__art {
  width: 104px;
  height: 104px;
  flex: none;
  object-fit: contain;
  margin-top: -8px;
  filter: drop-shadow(0 12px 24px rgba(132, 78, 220, 0.22));
}

/* ============ PLATE (card) ============ */
.plate {
  background: var(--plate);
  border-radius: var(--radius-plate);
  padding: var(--space-6);
}
.plate--card {
  background: var(--white);
  box-shadow: var(--shadow-card);
}

/* ============ FORM ============ */
.field { display: block; margin-bottom: var(--space-4); }
.field:last-of-type { margin-bottom: 0; }
.field__label {
  display: block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13px;
  color: var(--fg-2);
  margin-bottom: 6px;
}
.input, .select {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--fg);
  background: var(--white);
  border: 1px solid var(--field-bd);
  border-radius: var(--radius-field);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}
.input::placeholder { color: var(--slate-300); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(132, 78, 220, 0.18);
}
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234D5566' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--purple);
  color: var(--white);
}
.btn--primary:hover { background: var(--brand-ink); }
.btn--ghost {
  background: transparent;
  color: var(--fg-2);
  border-color: var(--field-bd);
}
.btn--ghost:hover { background: rgba(2, 2, 5, 0.04); color: var(--fg); }
.btn--block { width: 100%; }
.btn-row { margin-top: var(--space-5); }

/* ============ LINKS ============ */
a { color: var(--brand-ink); text-underline-offset: 0.14em; }
a:hover { color: var(--purple); }
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--fg-3);
  text-decoration: none;
  margin-bottom: var(--space-5);
}
.backlink:hover { color: var(--fg-2); }

/* ============ MENU (dashboard action list) ============ */
.menu { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-6) 0; }
.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--plate);
  border-radius: var(--radius-field);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--fg);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.menu__item:hover { background: var(--lilac-200); color: var(--fg); }
.menu__item:hover .menu__chev { transform: translateX(3px); }
.menu__title { font-weight: 500; flex: 1; }
.menu__chev { color: var(--slate-400); transition: transform 0.15s ease; flex: none; }

/* ============ TAG / PILL ============ */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  background: var(--mist);
  color: var(--fg-2);
}
.tag--admin { background: var(--lilac-200); color: var(--brand-ink); }

/* ============ ALERTS ============ */
.alert {
  display: flex;
  gap: 10px;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-field);
  margin-bottom: var(--space-5);
}
.alert--ok  { background: var(--ok-bg);  color: var(--ok); }
.alert--err { background: var(--err-bg); color: var(--err); }
.alert__dot { flex: none; margin-top: 1px; }

/* ============ TABLE ============ */
.table-wrap { overflow-x: auto; margin: var(--space-5) 0 var(--space-7); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 14px;
}
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--fg-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(132, 78, 220, 0.04); }
.table__id { color: var(--fg-3); font-variant-numeric: tabular-nums; }

/* ============ MISC ============ */
.stack-gap { margin-top: var(--space-6); }
.section-title { margin: var(--space-7) 0 var(--space-4); }

@media (max-width: 480px) {
  .shell { padding: var(--space-7) var(--space-4) var(--space-6); }
  .h1 { font-size: 30px; }
  .hero__art { width: 84px; height: 84px; }
  .brandbar { padding: 0 var(--space-4); }
}
