/* ==========================================================================
   Cantata UAE — Personal account (dashboard-retail)
   Бренд-ядро (шрифты + токены) продублировано из ../../styles.css — «вариант A»
   из design-system.md. Меняется бренд — синхронизировать оба места.
   ========================================================================== */

/* ---------- Бренд-шрифты (self-hosted) --------------------------------- */
@font-face{font-family:'Intro';src:url('fonts/INTRO-REGULAR.OTF') format('opentype');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Intro';src:url('fonts/INTRO-BOLD.OTF') format('opentype');font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:'Intro';src:url('fonts/INTRO-BLACK.OTF') format('opentype');font-weight:900;font-style:normal;font-display:swap}
@font-face{font-family:'Intro Caps';src:url('fonts/INTRO-REGULAR-CAPS.OTF') format('opentype');font-weight:400;font-display:swap}
@font-face{font-family:'Lato';src:url('fonts/LATO-LIGHT.TTF') format('truetype');font-weight:300;font-style:normal;font-display:swap}
@font-face{font-family:'Lato';src:url('fonts/LATO-REGULAR.TTF') format('truetype');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Lato';src:url('fonts/LATO-MEDIUM.TTF') format('truetype');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:'Lato';src:url('fonts/LATO-SEMIBOLD.TTF') format('truetype');font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:'Lato';src:url('fonts/LATO-BOLD.TTF') format('truetype');font-weight:700;font-style:normal;font-display:swap}

/* ---------- Токены (выжимка из :root портала) -------------------------- */
:root{
  --bg:          #ffffff;
  --bg-soft:     #f4efe8;
  --bg-accent:   #efe3ce;
  --text:        #2a2a28;
  --text-soft:   #6b6760;
  --text-muted:  #8a8378;
  --line:        #e7e0d6;
  --brand:       #584538;
  --accent:      #584538;
  --gold:        #c9a86a;
  --berry:       #9b2d3a;
  --green:       #4c5a37;
  --font-head: 'Intro', system-ui, -apple-system, sans-serif;
  --font-caps: 'Intro Caps', 'Intro', system-ui, sans-serif;
  --font-body: 'Lato', system-ui, -apple-system, sans-serif;
  --radius: 14px;
}

*{box-sizing:border-box}
/* Убираем зум по двойному тапу на телефоне (double-tap-to-zoom) на всех элементах. */
html{touch-action:manipulation}
html,body{margin:0;padding:0}
body{
  font-family:var(--font-body);
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, #faf5ec 0%, transparent 60%),
    var(--bg-soft);
  min-height:100vh;
  display:flex;
  flex-direction:column;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--accent);text-decoration:none}

/* ---------- Шапка ------------------------------------------------------ */
.auth-header{
  padding:22px 28px;
  display:flex;
  justify-content:center;
}
.auth-header img{height:26px;display:block}

/* ---------- Центр ------------------------------------------------------ */
.auth-main{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px 20px 56px;
}
.auth-card{
  width:100%;
  max-width:420px;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:0 24px 60px -30px rgba(88,69,56,.35);
  padding:34px 32px 30px;
}
.auth-eyebrow{
  font-family:var(--font-caps);
  text-transform:uppercase;
  letter-spacing:.16em;
  font-size:11px;
  color:var(--text-muted);
  text-align:center;
}
.auth-title{
  font-family:var(--font-head);
  font-weight:700;
  font-size:26px;
  text-align:center;
  margin:8px 0 22px;
}

/* ---------- Табы ------------------------------------------------------- */
.auth-tabs{
  display:flex;
  gap:4px;
  background:var(--bg-soft);
  border-radius:999px;
  padding:4px;
  margin-bottom:24px;
}
.auth-tab{
  flex:1;
  border:0;
  background:transparent;
  cursor:pointer;
  padding:9px 0;
  border-radius:999px;
  font-family:var(--font-caps);
  text-transform:uppercase;
  letter-spacing:.1em;
  font-size:11px;
  color:var(--text-muted);
  transition:background .2s,color .2s;
}
.auth-tab.is-active{
  background:var(--brand);
  color:#fff;
}

/* ---------- Формы ------------------------------------------------------ */
.auth-form{display:none;flex-direction:column;gap:14px}
.auth-form.is-active{display:flex}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field-row{display:flex;gap:12px}
.field-row .field{flex:1 1 0}
.phone-row{display:flex;gap:8px}
.phone-row input{flex:1 1 auto;min-width:0}
.phone-cc{
  flex:0 0 auto;
  font-family:var(--font-body);
  font-size:15px;
  color:var(--text);
  padding:11px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  transition:border-color .15s, box-shadow .15s;
}
.phone-cc:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(88,69,56,.1)}
.field label{
  font-family:var(--font-caps);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:10.5px;
  color:var(--text-muted);
}
.field input{
  width:100%;
  font-family:var(--font-body);
  font-size:15px;
  color:var(--text);
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  transition:border-color .15s, box-shadow .15s;
}
.field input:focus{
  outline:none;
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(88,69,56,.1);
}
.field .hint{font-size:12px;color:var(--text-muted)}
.field .error{
  font-size:12px;
  color:var(--berry);
  min-height:0;
}
.field.has-error .error{margin-top:2px}
.field.has-error input{
  border-color:var(--berry);
  box-shadow:0 0 0 3px rgba(155,45,58,.1);
}
.form-error{
  margin:2px 0 0;text-align:center;font-size:13px;color:var(--berry);
  background:rgba(155,45,58,.07);border:1px solid rgba(155,45,58,.2);
  border-radius:10px;padding:9px 12px;
}

.btn-primary{
  margin-top:6px;
  border:0;
  cursor:pointer;
  background:var(--brand);
  color:#fff;
  font-family:var(--font-caps);
  text-transform:uppercase;
  letter-spacing:.1em;
  font-size:12px;
  padding:13px 18px;
  border-radius:999px;
  transition:opacity .2s, transform .05s;
}
.btn-primary:hover{opacity:.9}
.btn-primary:active{transform:translateY(1px)}

.auth-foot{
  margin-top:18px;
  text-align:center;
  font-size:12.5px;
  color:var(--text-muted);
  line-height:1.5;
}

/* ---------- Экран успеха (заявка отправлена) --------------------------- */
.auth-success{
  display:none;
  flex-direction:column;
  align-items:center;
  text-align:center;
  padding:8px 4px 4px;
}
.auth-success.is-active{display:flex}
/* В состоянии успеха прячем шапку карточки и ссылку назад — оставляем только подтверждение */
.auth-card.is-success .auth-eyebrow,
.auth-card.is-success .auth-title,
.auth-card.is-success .back-link{display:none}

/* Экран ввода 2FA-кода при входе: убираем шапку и табы, ссылку «назад» на кабинет */
#si-totp-back,#si-totp-foot{display:none}
.auth-card.is-totp .auth-eyebrow,
.auth-card.is-totp .auth-title,
.auth-card.is-totp .auth-tabs,
.auth-card.is-totp #si-foot,
.auth-card.is-totp #kb-back{display:none}
.auth-card.is-totp #si-totp-back{display:block}
.auth-card.is-totp #si-totp-foot{display:block}
.auth-success__badge{
  width:56px;
  height:56px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--brand);
  color:#fff;
  font-size:26px;
  line-height:1;
  margin-bottom:18px;
}
.auth-success__title{
  font-family:var(--font-head);
  font-weight:700;
  font-size:22px;
  margin:0 0 10px;
}
.auth-success__text{
  margin:0 0 22px;
  font-size:14px;
  line-height:1.55;
  color:var(--text-soft);
  max-width:320px;
}
.auth-success .btn-primary{align-self:stretch;margin-top:0}

.back-link{
  display:block;
  text-align:center;
  margin-top:20px;
  font-family:var(--font-caps);
  text-transform:uppercase;
  letter-spacing:.1em;
  font-size:11px;
  color:var(--text-muted);
}
.back-link:hover{color:var(--brand)}

/* ---------- Онбординг (2FA + селфи) ------------------------------------ */
.ob-card{text-align:center}

.ob-progress{
  display:flex;
  gap:8px;
  margin-bottom:24px;
}
.ob-progress__step{
  flex:1;
  height:4px;
  border-radius:999px;
  background:var(--line);
  transition:background .25s;
}
.ob-progress__step.is-active{background:var(--brand)}

.ob-step{display:none;flex-direction:column;align-items:center}
.ob-step.is-active{display:flex}

.ob-lead{
  margin:6px 0 22px;
  font-size:14px;
  line-height:1.55;
  color:var(--text-soft);
  max-width:320px;
}

/* QR */
.ob-qr{
  padding:14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  line-height:0;
}
.ob-qr svg{width:164px;height:164px}

.ob-add-btn{
  display:inline-flex;align-items:center;justify-content:center;
  align-self:stretch;margin-top:4px;
  background:var(--brand);color:#fff;
  border-radius:999px;padding:13px 18px;
  font-family:var(--font-caps);text-transform:uppercase;letter-spacing:.1em;font-size:12px;
}
.ob-add-btn:hover{opacity:.9;text-decoration:none;color:#fff}

.ob-secret{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  margin:16px 0 6px;
}
.ob-secret__label{font-size:12px;color:var(--text-muted)}
.ob-secret__key{
  font-family:var(--font-body);
  font-weight:600;
  letter-spacing:.14em;
  font-size:14px;
  color:var(--text);
  background:var(--bg-soft);
  padding:7px 12px;
  border-radius:8px;
}

/* Поле кода */
.ob-code-field{width:100%;max-width:220px;margin-top:20px}
.ob-code-input{
  text-align:center;
  font-size:22px !important;
  letter-spacing:.4em;
  font-weight:600;
  padding-left:0 !important;
  padding-right:0 !important;
}

.ob-next{align-self:stretch;margin-top:22px}

.ob-back{
  margin-top:14px;
  border:0;
  background:transparent;
  cursor:pointer;
  font-family:var(--font-caps);
  text-transform:uppercase;
  letter-spacing:.1em;
  font-size:11px;
  color:var(--text-muted);
}
.ob-back:hover{color:var(--brand)}

/* Селфи */
.ob-selfie{display:flex;flex-direction:column;align-items:center;gap:16px;margin-bottom:20px}
.ob-selfie__preview{
  width:150px;
  height:150px;
  border-radius:50%;
  background:var(--bg-soft) center/cover no-repeat;
  border:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
}
.ob-selfie__preview.has-photo{border-color:var(--brand)}
.ob-selfie__placeholder{font-size:12px;color:var(--text-muted)}
.ob-selfie__preview.has-photo .ob-selfie__placeholder{display:none}
.ob-selfie__btn{
  cursor:pointer;
  border:1px solid var(--brand);
  color:var(--brand);
  background:transparent;
  border-radius:999px;
  padding:9px 18px;
  font-family:var(--font-caps);
  text-transform:uppercase;
  letter-spacing:.1em;
  font-size:11px;
  transition:background .2s,color .2s;
}
.ob-selfie__btn:hover{background:var(--brand);color:#fff}

.ob-consent{
  display:flex;
  gap:10px;
  text-align:left;
  font-size:13px;
  line-height:1.5;
  color:var(--text-soft);
  margin-bottom:4px;
}
.ob-consent input{margin-top:2px;flex:0 0 auto;accent-color:var(--brand)}
.ob-consent__link{color:var(--brand);text-decoration:underline}

.btn-primary:disabled{opacity:.45;cursor:not-allowed}

.ob-done .auth-success__badge{margin-bottom:20px}

/* ---------- Юридическая / текстовая страница (Privacy notice) ---------- */
.legal{
  max-width:640px;
  margin:0 auto;
  padding:8px 20px 56px;
}
.legal-eyebrow{
  font-family:var(--font-caps);
  text-transform:uppercase;
  letter-spacing:.14em;
  font-size:11px;
  color:var(--text-muted);
}
.legal h1{
  font-family:var(--font-head);
  font-weight:700;
  font-size:28px;
  margin:6px 0 4px;
}
.legal-meta{font-size:13px;color:var(--text-muted);margin:0 0 20px}
.legal-flag{
  background:var(--bg-accent);
  border:1px solid #e6d3ad;
  color:#6b5327;
  border-radius:12px;
  padding:12px 14px;
  font-size:13px;
  line-height:1.5;
  margin-bottom:24px;
}
.legal-flag code{
  font-family:var(--font-body);
  background:rgba(0,0,0,.05);
  padding:1px 5px;
  border-radius:5px;
}
.legal-intro{font-size:15.5px;line-height:1.6;color:var(--text-soft);margin:0 0 26px}
.legal h2{
  font-family:var(--font-head);
  font-weight:700;
  font-size:18px;
  margin:26px 0 8px;
}
.legal p{font-size:15px;line-height:1.6;color:var(--text);margin:0 0 12px}
.legal ul{margin:0 0 14px;padding-left:20px}
.legal li{font-size:15px;line-height:1.55;color:var(--text);margin-bottom:6px}
.legal a{color:var(--brand);text-decoration:underline}
.legal code{font-family:var(--font-body)}
.legal-back{margin-top:32px;text-align:left}

@media (max-width:440px){
  .auth-card{padding:28px 22px}
  .field-row{flex-direction:column;gap:14px}
}

/* Десктоп — вторичная адаптация (база — под телефон) */
@media (min-width:560px){
  .legal{padding:16px 24px 72px}
  .legal h1{font-size:34px}
  .legal h2{font-size:20px}
}

/* Десктоп — вторичная адаптация (mobile-first: база выше — под телефон) */
@media (min-width:560px){
  .ob-qr svg{width:180px;height:180px}
}
