/* ============================================================
   urok-expert / shared.css
   Общие стили для страниц авторизации и ЛК
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:      #1A1F2E;
  --red:      #C5482C;
  --blue:     #4B7A8A;
  --mid:      #8A8070;
  --paper:    #FAF6EE;
  --cream:    #F5F0E8;
  --parchment:#E8D5A3;
  --line:     rgba(26,31,46,0.08);
  --surface:  #FFFFFF;
  --success:  #5A8040;
  --error:    #C5482C;
}

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

/* ── Topbar ── */
.topbar {
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-logo {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700;
  color: var(--ink); text-decoration: none;
}
.topbar-logo span { color: var(--red); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-link { font-size: 14px; color: var(--mid); text-decoration: none; transition: color .2s; }
.topbar-link:hover { color: var(--ink); }

/* ── Auth card ── */
.auth-wrap {
  min-height: calc(100vh - 56px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 48px 40px;
  width: 100%; max-width: 420px;
}
.auth-eyebrow {
  font-family: 'Courier Prime', monospace;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--red); margin-bottom: 12px;
}
.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 700; line-height: 1.2;
  color: var(--ink); margin-bottom: 8px;
}
.auth-sub { font-size: 14px; color: var(--mid); margin-bottom: 32px; }

/* ── Form fields ── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: 'Courier Prime', monospace;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--mid); margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 4px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 15px; color: var(--ink);
  outline: none;
  transition: border-color .2s;
}
.field input:focus { border-color: var(--blue); background: white; }
.field input::placeholder { color: rgba(26,31,46,0.3); }
.field input.error-input { border-color: var(--red); }

/* ── Buttons ── */
.btn-full {
  width: 100%; padding: 14px;
  background: var(--red); color: white; border: none;
  border-radius: 4px; font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .15s;
  margin-top: 8px;
}
.btn-full:hover { background: #a83b22; transform: translateY(-1px); }
.btn-full:disabled { background: #ccc; cursor: not-allowed; transform: none; }

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

/* ── Messages ── */
.msg {
  border-radius: 4px; padding: 12px 16px;
  font-size: 14px; line-height: 1.5;
  margin-bottom: 16px; display: none;
}
.msg.show { display: block; }
.msg-error { background: #fdf0ed; border: 1px solid rgba(197,72,44,0.2); color: var(--red); }
.msg-success { background: #f0f7eb; border: 1px solid rgba(90,128,64,0.2); color: var(--success); }

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

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

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

/* ── Dashboard layout ── */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px);
}
.dash-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 32px 16px;
}
.dash-nav { list-style: none; }
.dash-nav li { margin-bottom: 4px; }
.dash-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 4px;
  font-size: 14px; font-weight: 500; color: var(--mid);
  text-decoration: none; transition: all .15s;
}
.dash-nav a:hover { background: var(--paper); color: var(--ink); }
.dash-nav a.active { background: var(--paper); color: var(--ink); font-weight: 600; }
.dash-nav a.active::before { content: ''; width: 3px; height: 16px; background: var(--red); border-radius: 2px; flex-shrink: 0; }
.dash-nav-icon { font-size: 16px; flex-shrink: 0; }

.dash-sidebar-divider { height: 1px; background: var(--line); margin: 16px 0; }
.dash-sidebar-label {
  font-family: 'Courier Prime', monospace;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--mid); padding: 0 14px; margin-bottom: 8px;
}

.dash-main { padding: 40px 48px; background: var(--paper); overflow-y: auto; }
.dash-header { margin-bottom: 32px; }
.dash-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 32px; font-weight: 700; color: var(--ink); margin-bottom: 4px;
}
.dash-header p { font-size: 15px; color: var(--mid); }

/* ── Dashboard cards ── */
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px; padding: 24px;
}
.stat-card-label {
  font-family: 'Courier Prime', monospace;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--mid); margin-bottom: 8px;
}
.stat-card-value {
  font-family: 'Playfair Display', serif;
  font-size: 36px; font-weight: 700; color: var(--ink); line-height: 1;
}
.stat-card-sub { font-size: 13px; color: var(--mid); margin-top: 4px; }

/* ── Plan badge ── */
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 2px; padding: 4px 10px;
  font-family: 'Courier Prime', monospace;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink);
}
.plan-badge.pro { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.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-family: 'Courier Prime', monospace;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--mid); text-align: left;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.history-table td {
  padding: 14px 16px; font-size: 14px; color: var(--ink);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: var(--paper); }
.doc-type {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--mid);
  background: var(--paper); border-radius: 2px;
  padding: 2px 8px;
}

/* ── Progress bar (лимит) ── */
.limit-bar-wrap { margin-top: 8px; }
.limit-bar-track {
  height: 4px; background: var(--line); border-radius: 2px; overflow: hidden;
}
.limit-bar-fill {
  height: 100%; background: var(--blue); border-radius: 2px;
  transition: width .4s ease;
}
.limit-bar-fill.warn { background: #C57A2C; }
.limit-bar-fill.danger { background: var(--red); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .dash-main { padding: 24px 20px; }
  .dash-stats { grid-template-columns: 1fr; }
  .topbar { padding: 0 20px; }
  .auth-card { padding: 32px 24px; }
}
