/* ── Fonts (Kamerik) ───────────────────────────────────────────────────────── */
@font-face { font-family: 'Kamerik'; src: url('/static/fonts/Kamerik105Cyrillic-Light.ttf') format('truetype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Kamerik'; src: url('/static/fonts/Kamerik105Cyrillic-Book.ttf')  format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Kamerik'; src: url('/static/fonts/Kamerik105Cyrillic-Bold.ttf')  format('truetype'); font-weight: 700; font-display: swap; }

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens — exact match to Move / app.css ──────────────────────── */
:root {
  --bg:          #F0F4FB;
  --surface:     #ffffff;
  --border:      #DDE6F5;
  --border-soft: #E8EFF8;
  --text:        #1A1D2E;
  --body-txt:    #3A4460;
  --muted:       #8892A4;
  --accent:      #246DEE;
  --accent-h:    #1a56c4;
  --accent-tint: rgba(36,109,238,.06);
  --accent-ring: rgba(36,109,238,.1);
  --danger:      #ef4444;
  --danger-bg:   #fee2e2;
  --danger-bd:   #fca5a5;
  --success:     #22c55e;
  --success-bg:  #f0fdf4;
  --radius-sm:   8px;
  --radius:      9px;
  --radius-card: 16px;
  --shadow:      0 4px 24px rgba(36,109,238,.07), 0 1px 4px rgba(0,0,0,.04);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
html, body { min-height: 100vh; }
body {
  font-family: 'Kamerik', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Page shell ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

/* Register page — top-aligned, more room */
.auth-page--wide {
  justify-content: flex-start;
  padding-top: 0;
  padding-bottom: 4rem;
}

/* ── Inner wrapper (groups back link + logo + card together) ─────────────── */
.auth-inner {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
}

.auth-inner--wide { max-width: 720px; }

/* ── Back link (top-left pill) ───────────────────────────────────────────── */
.auth-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  align-self: flex-start;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
  padding: .28rem .75rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: #fff;
  transition: all .2s;
  margin-bottom: 1.25rem;
  text-decoration: none;
}
.auth-back:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #EBF1FD;
  text-decoration: none;
}

/* ── Logo ────────────────────────────────────────────────────────────────── */
.auth-logo {
  text-align: center;
  margin-bottom: 1.85rem;
  margin-top: .75rem;
}
.auth-logo img {
  height: 32px;
  width: auto;
  display: block;
  margin: 0 auto;
}
/* Fallback text if image fails */
.auth-logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--text);
}

/* Register top-nav: back left · logo center · spacer right */
.auth-topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 1.25rem;
  position: relative;
}
.auth-topnav .auth-back { margin-bottom: 0; }
.auth-topnav-logo {
  height: 32px;
  width: auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.auth-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 2.1rem 2rem 1.8rem;
  width: 100%;
}

.auth-card--picker { max-width: 520px; }
.auth-card--reg {
  border-radius: 14px;
  padding: 1.85rem 2rem 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(36,109,238,.06), 0 1px 4px rgba(0,0,0,.03);
}

.auth-card h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.022em;
  color: var(--text);
  margin-bottom: .22rem;
}

.subtitle {
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.6rem;
}

/* ── Alert ───────────────────────────────────────────────────────────────── */
.auth-alert {
  background: var(--danger-bg);
  border: 1px solid var(--danger-bd);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: .84rem;
  padding: .65rem .9rem;
  margin-bottom: 1.1rem;
}

/* ── Section labels (register form) ─────────────────────────────────────── */
.section-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: .48rem;
  margin: 1.35rem 0 .85rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.section-label i { color: var(--accent); font-size: .58rem; }

/* ── Trial notice (register) ─────────────────────────────────────────────── */
.trial-notice {
  background: var(--accent-tint);
  border: 1px solid rgba(36,109,238,.18);
  border-radius: var(--radius);
  padding: .7rem 1rem;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.35rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.trial-notice i       { color: var(--accent); flex-shrink: 0; }
.trial-notice strong  { color: var(--accent); font-weight: 700; }

/* ── Form fields ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: .82rem;
}

label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--body-txt);
  display: block;
  margin-bottom: .28rem;
  letter-spacing: .02em;
}

.req, .text-danger { color: var(--danger); }

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: .82rem;
  top: 50%;
  transform: translateY(-50%);
  color: #B0BBD0;
  font-size: .78rem;
  pointer-events: none;
  z-index: 1;
  transition: color .2s;
}
.field-wrap:focus-within .field-icon { color: var(--accent); }

/* All text inputs */
.form-control,
.field-wrap input,
.field-wrap select {
  width: 100%;
  padding: .62rem .9rem .62rem 2.3rem;
  background: #F4F7FC;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 400;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s;
  appearance: none;
  -webkit-appearance: none;
}

/* Inputs that have no leading icon (no .field-icon sibling) */
.form-control {
  padding: .5rem .8rem;
}

.field-wrap input:focus,
.field-wrap select:focus,
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.field-wrap input::placeholder,
.form-control::placeholder { color: #A8B4C8; }

/* Custom select arrow */
.field-wrap select,
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a99' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

.errMsg {
  color: var(--danger);
  font-size: .73rem;
  display: block;
  margin-top: .18rem;
}

.hint, .pw-hint, .field-opt {
  font-size: .71rem;
  color: var(--muted);
  margin-top: .18rem;
  font-weight: 500;
}

/* ── Domain field ────────────────────────────────────────────────────────── */
.domain-input-wrap { display: flex; }
.domain-input-wrap .form-control {
  border-radius: var(--radius) 0 0 var(--radius);
  flex: 1;
}
.domain-addon {
  display: inline-flex;
  align-items: center;
  padding: 0 .85rem;
  background: #EBF1FD;
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  height: 36px;
  white-space: nowrap;
}

.domain-preview {
  font-size: .73rem;
  color: var(--muted);
  margin-top: .28rem;
}
.domain-preview strong { color: var(--accent); }

.domain-status.ok     { color: var(--success); font-weight: 700; }
.domain-status.taken,
.domain-status.err    { color: var(--danger); font-weight: 700; }
.domain-status.checking { color: var(--muted); }

/* ── Phone row ───────────────────────────────────────────────────────────── */
.phone-wrap { display: flex; }
.phone-wrap .form-control:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
  border-right: none;
  width: 130px;
  flex-shrink: 0;
}
.phone-wrap .phone-input {
  border-radius: 0 var(--radius) var(--radius) 0;
  flex: 1;
}

/* ── Bootstrap-compatible row/col ────────────────────────────────────────── */
.row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 0; }
.row .form-group { flex: 1; min-width: 0; margin-bottom: .82rem; }
[class*="col-sm-"] { flex: none; }
.col-sm-3  { width: calc(25% - 7px); }
.col-sm-4  { width: calc(33.33% - 10px); }
.col-sm-5  { width: calc(41.66% - 8px); }
.col-sm-6  { width: calc(50% - 7px); }
.col-sm-12 { width: 100%; }

/* ── Primary button ──────────────────────────────────────────────────────── */
.btn-primary,
.btn-register,
.btn-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .72rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background .2s, transform .22s, box-shadow .22s;
  margin-top: .5rem;
}
.btn-primary:hover,
.btn-register:hover,
.btn-signin:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(36,109,238,.3);
  color: #fff;
  text-decoration: none;
}
.btn-primary:active,
.btn-register:active,
.btn-signin:active { transform: translateY(0); box-shadow: none; }
.btn-primary:disabled,
.btn-register:disabled,
.btn-signin:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Card footer (sign-in / register link) ───────────────────────────────── */
.auth-footer,
.login-link {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-soft);
  text-align: center;
  font-size: .8rem;
  font-weight: 400;
  color: var(--muted);
}
.auth-footer a,
.login-link a { color: var(--accent); font-weight: 700; }
.auth-footer a:hover,
.login-link a:hover { color: var(--accent-h); text-decoration: underline; }

/* ── Page bottom links ───────────────────────────────────────────────────── */
.auth-bottom {
  display: flex;
  gap: 10px;
  font-size: .75rem;
  color: var(--muted);
  align-items: center;
  margin-top: 1.5rem;
}
.auth-bottom a       { color: var(--muted); }
.auth-bottom a:hover { color: var(--text); text-decoration: none; }

/* ── Reg card header ─────────────────────────────────────────────────────── */
.reg-card-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 .2rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.reg-card > p {
  font-size: .82rem;
  color: #6B7A99;
  margin: 0 0 1.1rem;
  font-weight: 500;
}

/* ── Product picker ──────────────────────────────────────────────────────── */
.picker-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.picker-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: .88rem;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.picker-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: rgba(36,109,238,.02);
}

.picker-tile-icon {
  width: 40px;
  height: 40px;
  background: var(--bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}
.picker-tile-body  { flex: 1; display: flex; flex-direction: column; }
.picker-tile-name  { font-weight: 700; color: var(--text); }
.picker-tile-sub   { font-size: .73rem; color: var(--muted); margin-top: 2px; }
.picker-tile-arrow { color: var(--muted); font-size: .85rem; }

/* ── Success modal (register) ────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: #fff;
  border-radius: 18px;
  padding: 2.5rem 2.25rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.modal-icon {
  width: 56px;
  height: 56px;
  background: var(--success-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--success);
  margin: 0 auto 1.25rem;
}
.modal-box h2 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--text); }
.modal-box p  { color: var(--muted); margin-bottom: 1.5rem; font-size: .85rem; }

/* ── Global message ──────────────────────────────────────────────────────── */
#globalMsg { font-size: .82rem; margin: .55rem 0 0; text-align: center; min-height: 18px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .auth-card--reg { padding: 1.5rem 1.25rem 1.25rem; }
  .row { flex-direction: column; gap: 0; }
  [class*="col-sm-"] { width: 100%; }
  .phone-wrap .form-control:first-child { width: 110px; }
}
@media (max-width: 480px) {
  .auth-card { padding: 1.5rem 1.25rem 1.25rem; }
}
