/* Екрани за вход, регистрация, профил, планове и правни текстове.
   Наследява променливите и стъклената рецепта от style.css. */

.auth-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
}

.auth-shell {
  display: grid; grid-template-columns: 440px 1fr;
  gap: 52px; align-items: center;
  max-width: 1080px; width: 100%;
}
@media (max-width: 940px) {
  .auth-shell { grid-template-columns: 1fr; gap: 30px; }
  .auth-side { order: -1; }
}

.auth-card {
  border-radius: var(--r-xl);
  padding: 34px 32px 24px;
  box-shadow:
    inset 0 1px 0 var(--rim),
    inset 0 -1px 0 rgba(0, 0, 0, .3),
    var(--shadow-lg);
}

.auth-brand {
  display: flex; align-items: center; gap: 11px;
  font-weight: 640; font-size: 16px; letter-spacing: -.02em;
  margin-bottom: 26px;
}
.auth-brand .logo {
  width: 30px; height: 30px; display: block; border-radius: 10px;
  filter: drop-shadow(0 4px 12px rgba(126, 123, 255, .40));
}

.auth-form { display: none; }
.auth-form.active { display: block; animation: rise .32s cubic-bezier(.32, .72, 0, 1); }

.auth-form h1 { font-size: 24px; margin: 0 0 7px; font-weight: 640; letter-spacing: -.03em; }
.auth-hint { color: var(--muted); font-size: 13px; margin: 0 0 20px; line-height: 1.6; }

.auth-form label { display: block; margin-bottom: 16px; font-size: 12.5px; color: var(--muted); }
.auth-form input[type=email],
.auth-form input[type=password],
.auth-form input[type=text] {
  display: block; width: 100%; margin-top: 7px;
  background: rgba(255, 255, 255, .05); color: var(--text);
  border: 1px solid var(--border); border-radius: 13px;
  padding: 12px 14px; font: 14.5px/1.4 var(--font); letter-spacing: -.01em;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.auth-form input:hover { background: rgba(255, 255, 255, .07); }
.auth-form input:focus {
  border-color: rgba(126, 123, 255, .65);
  background: rgba(126, 123, 255, .08);
  box-shadow: 0 0 0 4px rgba(126, 123, 255, .16);
}
@supports (corner-shape: squircle) {
  .auth-form input, .auth-card { corner-shape: squircle; }
}
.field-hint { display: block; margin-top: 6px; font-size: 11.5px; color: var(--faint); }

.checkline {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
  margin-bottom: 18px !important;
}
.checkline input { margin-top: 2px; flex-shrink: 0; }
.checkline a { color: var(--accent); }

.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 12.5px; }
.auth-links a { color: var(--muted); text-decoration: none; transition: color .16s; }
.auth-links a:hover { color: var(--accent); }

.auth-message {
  margin-top: 18px; padding: 12px 15px; border-radius: var(--r);
  font-size: 13px; line-height: 1.6; display: none;
  border: 1px solid transparent;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.auth-message.show { display: block; animation: rise .3s cubic-bezier(.32, .72, 0, 1); }
.auth-message.err { background: var(--down-dim); color: #FFA9A2; border-color: rgba(255, 69, 58, .28); }
.auth-message.ok  { background: var(--up-dim);   color: #93E7AC; border-color: rgba(48, 209, 88, .28); }
.auth-message a { color: inherit; text-decoration: underline; }

.auth-foot {
  margin-top: 24px; padding-top: 17px;
  border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--faint); text-align: center;
}
.auth-foot a { color: var(--faint); text-decoration: none; }
.auth-foot a:hover { color: var(--muted); }

.auth-side { color: var(--muted); }
.auth-side h2 { color: var(--text); font-size: 30px; margin: 0 0 16px; font-weight: 640; letter-spacing: -.035em; line-height: 1.2; }
.auth-side p { font-size: 14px; line-height: 1.75; margin: 0 0 15px; max-width: 470px; }
.auth-warn {
  border-left: 3px solid var(--warn);
  padding-left: 15px; color: var(--text-2); font-size: 12.5px !important;
}

/* ---------- профил, админ, планове ---------- */
.page { max-width: 1040px; margin: 0 auto; padding: 28px 22px 72px; }
.page h1 { font-size: 27px; margin: 0 0 7px; font-weight: 640; letter-spacing: -.035em; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 28px; line-height: 1.6; }

.card { border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 16px; }
.card h2 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 0 0 14px; font-weight: 600;
}
.card .row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-size: 13.5px;
}
.card .row:last-child { border-bottom: 0; }
.card .row .k { color: var(--muted); }
.card .row .v {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form label { font-size: 12px; color: var(--muted); }
.inline-form input, .inline-form select {
  display: block; margin-top: 6px;
  background: rgba(255, 255, 255, .05); color: var(--text);
  border: 1px solid var(--border); border-radius: 11px;
  padding: 9px 12px; font: 13.5px var(--font); outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.inline-form input:focus, .inline-form select:focus {
  border-color: rgba(126, 123, 255, .65);
  box-shadow: 0 0 0 4px rgba(126, 123, 255, .16);
}

.meter { height: 7px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.meter.warn > i { background: linear-gradient(90deg, var(--warn), #FFC55A); }
.meter.full > i { background: linear-gradient(90deg, var(--down), #FF7A70); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.plan {
  border-radius: var(--r-xl); padding: 26px;
  transition: transform .22s cubic-bezier(.32, .72, 0, 1), border-color .22s;
}
.plan:hover { transform: translateY(-3px); }
.plan.current { border-color: rgba(126, 123, 255, .5); box-shadow: inset 0 1px 0 var(--rim), 0 0 0 1px rgba(126, 123, 255, .25), var(--shadow); }
.plan h3 { margin: 0 0 4px; font-size: 18px; font-weight: 620; letter-spacing: -.02em; }
.plan .price {
  font-size: 36px; font-family: var(--mono); font-variant-numeric: tabular-nums;
  margin: 12px 0 18px; font-weight: 660; letter-spacing: -.04em;
}
.plan .price small { font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: normal; }
.plan ul { list-style: none; padding: 0; margin: 0 0 20px; }
.plan li { padding: 7px 0 7px 24px; font-size: 13px; color: var(--text-2); position: relative; line-height: 1.55; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--up); font-weight: 600; }

.legal { max-width: 800px; }
.legal h2 { font-size: 18px; margin: 34px 0 12px; color: var(--text); text-transform: none; letter-spacing: -.02em; font-weight: 620; }
.legal h3 { font-size: 15px; margin: 22px 0 9px; color: var(--text); font-weight: 600; }
.legal p, .legal li { font-size: 14px; line-height: 1.8; color: var(--text-2); }
.legal ul { padding-left: 22px; }
.legal .updated { color: var(--faint); font-size: 12px; }
.legal strong { color: var(--text); font-weight: 600; }

/* ---------- горна лента на подстраниците ---------- */
.topnav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 20px;
  padding: 0 22px; height: 62px;
  background: rgba(10, 12, 19, .62);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-bottom: 1px solid var(--border);
}
.topnav a { color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: color .16s; }
.topnav a:hover, .topnav a.active { color: var(--text); }
.topnav .brand { font-weight: 640; color: var(--text); display: flex; gap: 10px; align-items: center; }
.topnav .spacer { flex: 1; }

/* ---------- потребителско меню ---------- */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font: 500 13px var(--font);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: background .16s, transform .16s cubic-bezier(.32, .72, 0, 1);
}
.user-btn:hover { background: rgba(255, 255, 255, .09); }
.user-btn:active { transform: scale(.96); }

.user-drop {
  position: absolute; right: 0; top: 46px; min-width: 224px;
  border-radius: var(--r); padding: 7px; display: none; z-index: 200;
  box-shadow: inset 0 1px 0 var(--rim), var(--shadow-lg);
}
.user-drop.open { display: block; animation: rise .22s cubic-bezier(.32, .72, 0, 1); }
.user-drop a, .user-drop button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 9px; font: 13px var(--font);
  color: var(--text); background: none; border: 0; cursor: pointer;
  text-decoration: none; transition: background .14s;
}
.user-drop a:hover, .user-drop button:hover { background: rgba(255, 255, 255, .08); }
.user-drop .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.user-drop .who { padding: 9px 12px; color: var(--muted); font-size: 12px; }

/* ==========================================================================
   Планове — пробата, превключвателят и картите
   ========================================================================== */
.plan-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; align-items: start;
}

/* Пробата е следващата стъпка на посетителя, затова стои НАД плановете. */
.trial-band {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 20px 24px; margin-bottom: 18px; border-radius: var(--r-lg, 20px);
  background: linear-gradient(120deg, rgba(126, 123, 255, .16), rgba(52, 210, 240, .10));
  border: 1px solid rgba(126, 123, 255, .30);
}
.trial-band h3 { margin: 0 0 6px; font-size: 19px; font-weight: 640; letter-spacing: -.02em; }
.trial-band p { margin: 0; font-size: 13px; color: var(--text-2); max-width: 62ch; line-height: 1.6; }

.period-switch {
  display: inline-flex; gap: 3px; margin: 0 0 18px;
  padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .045); border: 1px solid var(--border);
}
.period-switch button {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  padding: 8px 16px; border-radius: 999px; font: 500 13px/1 inherit;
  transition: background .18s, color .18s;
}
.period-switch button.on {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}

.plan.featured { border-color: rgba(126, 123, 255, .45); }
.plan-badge {
  display: inline-block; margin-bottom: 8px; padding: 4px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 560;
  background: rgba(126, 123, 255, .18); color: #C9C7FF;
  border: 1px solid rgba(126, 123, 255, .3);
}
.plan-tagline { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.price-note { margin: -8px 0 14px; font-size: 12px; color: var(--muted); }
.plan-after {
  margin-top: 20px; padding: 16px 18px; border-radius: var(--r, 14px);
  background: rgba(255, 255, 255, .03); border: 1px solid var(--border);
  font-size: 13px; line-height: 1.7; color: var(--text-2);
}
.plan-after strong { color: var(--text); }


/* Дребният правен текст: като клас, за да може мобилният слой да го стигне. */
.fineprint { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
@media (max-width: 720px) { .fineprint { font-size: 14px; } }

/* Телефон: под 16 пиксела iOS увеличава страницата при докосване на поле и
   не я връща — изглежда като счупен сайт, а е настройка на браузъра. */
@media (max-width: 720px) {
  .input, input.input, select.input, textarea { font-size: 16px; min-height: 44px; }
  .auth-form input[type=email],
  .auth-form input[type=password],
  .auth-form input[type=text],
  .inline-form input, .inline-form select { font-size: 16px; min-height: 44px; }
  /* Таблиците по страниците за профил и планове се плъзгат сами, вместо да
     бутат цялата страница настрани. */
  .card, .panel { overflow-x: auto; }
  .period-switch button { min-height: 42px; }
  .btn { min-height: 44px; }
  .auth-card { padding: 24px 20px; }
  .topnav { gap: 10px; padding: 8px 12px; overflow-x: auto; }
  .topnav a { white-space: nowrap; }
}
