/* ============================================================
   urok-expert / shared.css  v4 — синий + оранжевый
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1E40AF;
  --primary-hover: #1E3A8A;
  --primary-light: #DBEAFE;
  --accent:        #E8610A;
  --accent-hover:  #C94E08;
  --accent-light:  #FFF3EC;
  --logo-blue:     #1E5BBE;
  --dark:          #111827;
  --text:          #111827;
  --text-muted:    #6B7280;
  --surface:       #FFFFFF;
  --bg:            #F7F8FC;
  --border:        #E5E7EB;
  --border-focus:  #1E40AF;
  --success:       #16A34A;
  --success-bg:    #F0FDF4;
  --error:         #DC2626;
  --error-bg:      #FEF2F2;
  --warning:       #D97706;
  --shadow-sm:     0 1px 3px rgba(30,64,175,0.06), 0 1px 2px rgba(30,64,175,0.04);
  --shadow:        0 4px 16px rgba(30,64,175,0.1);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     6px;

  /* обратная совместимость */
  --ink:      #111827;
  --red:      #1E40AF;
  --blue:     #1E40AF;
  --mid:      #6B7280;
  --paper:    #F7F8FC;
  --cream:    #EFF6FF;
  --parchment:#DBEAFE;
  --line:     #E5E7EB;
  --error-color: #DC2626;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}
.topbar-logo {
  font-size: 18px; font-weight: 700;
  color: var(--logo-blue); text-decoration: none;
  letter-spacing: -0.3px;
}
.topbar-logo span { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-link {
  font-size: 14px; color: var(--text-muted); text-decoration: none;
  transition: color .2s; font-weight: 500;
}
.topbar-link:hover { color: var(--text); }

/* ── Auth ── */
.auth-wrap {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
}
.auth-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--primary);
  margin-bottom: 10px;
}
.auth-title {
  font-size: 28px; font-weight: 700; line-height: 1.2;
  color: var(--text); margin-bottom: 8px;
}
.auth-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

/* ── Form fields ── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text); margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 15px; color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,33,182,0.12);
}
.field input::placeholder { color: #C4BAE0; }
.field input.error-input { border-color: var(--error); }

/* ── Buttons ── */
.btn-full {
  width: 100%; padding: 13px;
  background: var(--accent); color: white; border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .15s, box-shadow .2s;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(232,97,10,0.25);
}
.btn-full:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232,97,10,0.3);
}
.btn-full:disabled { background: #C4BAE0; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost-full {
  width: 100%; padding: 12px;
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 500;
  cursor: pointer; transition: border-color .2s, background .2s, color .2s;
  margin-top: 8px; text-align: center; text-decoration: none;
  display: block;
}
.btn-ghost-full:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ── Messages ── */
.msg {
  border-radius: var(--radius-xs); padding: 12px 16px;
  font-size: 14px; line-height: 1.5;
  margin-bottom: 16px; display: none;
}
.msg.show { display: block; }
.msg-error { background: var(--error-bg); border: 1px solid rgba(220,38,38,0.2); color: var(--error); }
.msg-success { background: var(--success-bg); border: 1px solid rgba(22,163,74,0.2); color: var(--success); }

/* ── Divider ── */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0; color: var(--text-muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Footer link ── */
.auth-footer { margin-top: 24px; text-align: center; font-size: 14px; color: var(--text-muted); }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Password toggle ── */
.field-wrap { position: relative; }
.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: var(--text-muted); padding: 4px; line-height: 1;
}

/* ── Dashboard layout ── */
.dash-layout {
  display: grid;
  grid-template-columns: 68px 1fr;
  min-height: 100vh;
}

/* ── Dark icon sidebar ── */
.dash-sidebar {
  background: #1E3A8A;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 20px;
  position: sticky; top: 0; height: 100vh;
  overflow: visible;
  gap: 0;
}

.dash-logo-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  margin-bottom: 20px; flex-shrink: 0;
}
.dash-logo-wrap img { width: 40px; height: 40px; border-radius: 10px; display: block; }

.dash-nav {
  list-style: none;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; width: 100%; padding: 0;
  flex: 1;
}
.dash-nav li { width: 100%; display: flex; justify-content: center; }
.dash-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  width: 52px; height: 52px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  transition: background .15s, color .15s;
  position: relative;
}
.dash-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
}
.dash-nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.dash-nav-icon {
  font-size: 20px; line-height: 1; display: block;
}
.dash-nav-label {
  font-size: 9px; font-weight: 500; letter-spacing: 0.02em;
  line-height: 1; display: block; text-align: center;
}

.dash-nav-bottom {
  flex: 0 0 auto;
  margin-top: auto;
}

.dash-sidebar-divider {
  width: 32px; height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 10px 0; flex-shrink: 0;
}

.dash-sidebar-bottom {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 100%;
}

/* Tooltip on hover */
.dash-nav a[data-tip] {
  position: relative;
}
.dash-nav a[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%; transform: translateY(-50%);
  background: #111827;
  color: #fff;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.dash-main { padding: 32px 40px; background: var(--bg); overflow-y: auto; min-width: 0; }
.dash-header { margin-bottom: 28px; }
.dash-header h1 {
  font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.dash-header p { font-size: 15px; color: var(--text-muted); }

/* ── Dashboard cards ── */
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.stat-card-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
}
.stat-card-value {
  font-size: 36px; font-weight: 700; color: var(--text); line-height: 1;
}
.stat-card-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Plan badge ── */
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); border: 1px solid rgba(91,33,182,0.2);
  border-radius: 20px; padding: 5px 12px;
  font-size: 13px; font-weight: 600; color: var(--primary);
}
.plan-badge.pro { background: var(--primary); color: white; border-color: var(--primary); }
.plan-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* ── History table ── */
.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted); text-align: left;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.history-table td {
  padding: 14px 16px; font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: var(--bg); }
.doc-type {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 8px;
}
a.doc-type-link {
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
a.doc-type-link:hover {
  background: var(--primary-light); border-color: var(--primary);
  color: var(--primary);
}

/* ── Progress bar ── */
.limit-bar-wrap { margin-top: 10px; }
.limit-bar-track {
  height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.limit-bar-fill {
  height: 100%; background: var(--primary); border-radius: 3px;
  transition: width .4s ease;
}
.limit-bar-fill.warn { background: var(--warning); }
.limit-bar-fill.danger { background: var(--error); }

/* ── Email verification banner ── */
.email-verify-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  background: #EEF4FF;
  border: 1px solid #BFCFEF;
  border-left: 4px solid #1E5BBE;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 14px;
  color: #1E3A6E;
  box-shadow: 0 1px 4px rgba(30,91,190,.08);
}
.email-verify-banner-body {
  display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
}
.email-verify-banner-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: #DBEAFE; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.email-verify-banner-text strong { font-weight: 600; color: #1E3A6E; }
.email-verify-banner-sub { color: #2D5FAA; font-size: 13px; margin-top: 1px; display: block; }
.email-verify-banner-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.email-verify-resend-btn {
  background: #1E5BBE; border: none; border-radius: var(--radius-xs);
  padding: 7px 16px; font-family: 'Inter', sans-serif; font-size: 13px;
  font-weight: 600; color: #fff; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.email-verify-resend-btn:hover { background: #1749A0; }
.email-verify-resend-btn:disabled { opacity: .6; cursor: not-allowed; }
.email-verify-dismiss-btn {
  background: none; border: none; color: #2D5FAA; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 4px; opacity: .6;
  transition: opacity .15s; display: flex; align-items: center;
}
.email-verify-dismiss-btn:hover { opacity: 1; }

/* ── Mob header (все страницы ЛК) ── */
.mob-header {
  display: none; position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 16px; height: 56px;
  align-items: center; justify-content: space-between;
}
.mob-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.mob-logo-text { font-size: 17px; font-weight: 700; color: #1E5BBE; }
.mob-logo-text span { color: var(--accent); }
.burger-btn { background: none; border: none; cursor: pointer; padding: 4px; color: var(--text); }
.mobile-nav {
  display: none; position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
  background: var(--surface); z-index: 200; overflow-y: auto; padding: 12px 0;
  border-top: 1px solid var(--border);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 24px; font-size: 15px; color: var(--text);
  text-decoration: none; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.mobile-nav a:hover, .mobile-nav a.active { background: var(--bg); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .mob-header { display: flex; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none !important; }
  .dash-main { padding: 20px 16px; }
  .dash-stats { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .auth-card { padding: 32px 24px; }
  .email-verify-banner { flex-direction: column; align-items: flex-start; }
}
