/* =========================
   Modern Beeline UI (Apple-ish) — CLEAN (no duplicates)
   ========================= */

:root{
  --beeline-yellow:#FFD100;
  --beeline-black:#0B0B0B;
  --beeline-gray:#F5F5F7;            /* apple-like background */
  --text:#111827;
  --muted:#6B7280;
  --border:rgba(17,24,39,.10);
  --shadow:0 18px 45px rgba(0,0,0,.08);
  --shadow-sm:0 10px 25px rgba(0,0,0,.06);
  --radius:16px;
  --radius-sm:12px;
  --focus:0 0 0 4px rgba(255,209,0,.35);
  --btn-h:46px;
  --font: "Inter", "Roboto", system-ui, -apple-system, Segoe UI, Arial, sans-serif;

  /* unified button typography */
  --ui-btn-font-size: 15px;
  --ui-btn-line-height: 1.15;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background: var(--beeline-gray);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height:1.45;
}

/* Typography */
h1{
  margin: 4px 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
  text-align:center;
  color:var(--beeline-black);
}
h2{
  margin: 6px 0;
  font-size: 15px;
  font-weight: 500;
  text-align:center;
  color: var(--muted);
}
p{ margin: 10px 0; color: var(--text); }
a{ color:#0A66C2; text-decoration:none; }
a:hover{ text-decoration:underline; }

/* Layout container */
.container{
  max-width: 860px;
  margin: 28px auto;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

/* ===== Headers: logo left, titles centered (desktop) ===== */
.consent-header,
.form-header,
.success-header{
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
}

/* consent */
.consent-header{ margin-bottom: 16px; }
.consent-logo{
  height: 44px;
  width: auto;
  margin-left: 2px;
  opacity: 1;
  filter: none;
}
.consent-titles{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.consent-titles h1{
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--beeline-black);
}
.consent-titles h2{
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

/* form */
.form-header{ margin-bottom: 14px; }
.form-logo{
  height: 40px;
  width: auto;
  opacity: 1;
  filter: none;
}
.form-titles{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.form-titles h1{
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--beeline-black);
}

/* success */
.success-header{ margin-bottom: 16px; }
.success-logo{
  height: 40px;
  width: auto;
  opacity: 1;
  filter: none;
}
.success-titles{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.success-titles .page-title{ margin: 0; }

/* ===== Consent ===== */
.consent-box{
  padding: 6px;
  text-align:center;
}
.consent-text{
  text-align:left;
  margin: 14px 0 18px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.03);
  border: 1px solid var(--border);
  color: var(--text);
}
.consent-text p{
  margin: 10px 0;
  color: #374151;
  font-size: 14px;
}

/* ===== Form blocks ===== */
.form-group{
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.72);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

label{
  display:block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.hint{
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}
.hint2{
  font-weight: 500;
  color: #000;
  font-size: 12px;
}

/* Unified inputs */
.beeline-input,
input[type="tel"],
input[type="text"],
input[type="email"],
input[type="password"]{
  width:100%;
  height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 15px;
  outline: none;
  transition: box-shadow .18s ease, border-color .18s ease, transform .12s ease;
}

.beeline-input:hover,
input[type="tel"]:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover{
  border-color: rgba(17,24,39,.18);
}

.beeline-input:focus,
input[type="tel"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus{
  border-color: rgba(255,209,0,.95);
  box-shadow: var(--focus);
}

/* hide native file input */
input[type="file"]{ display:none; }

/* ===== Unified buttons (single source of truth) ===== */
.beeline-btn,
.file-upload-btn,
.btn{
  font-family: 'Roboto', sans-serif;
  font-size: var(--ui-btn-font-size);
  line-height: var(--ui-btn-line-height);
  font-weight: 600;

  height: var(--btn-h);
  border-radius: 14px;
  padding: 0 16px;
  letter-spacing: -0.01em;

  border: 1px solid rgba(0,0,0,.08);
  cursor:pointer;
  user-select:none;

  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  width:100%;

  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease, border-color .18s ease;
}

.beeline-btn{
  background: var(--beeline-yellow);
  color: #111;
  box-shadow: 0 10px 20px rgba(255,209,0,.22);
}
.beeline-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(255,209,0,.28);
}
.beeline-btn:active{
  transform: translateY(0px);
  opacity: .95;
}

.beeline-btn.secondary{
  background: #fff;
  color: #111;
  box-shadow: var(--shadow-sm);
}
.beeline-btn.secondary:hover{
  box-shadow: 0 14px 30px rgba(0,0,0,.08);
}

/* ✅ file upload buttons — выделенные (жёлтый градиент) */
.file-upload-btn{
  background: linear-gradient(180deg, #FFD100, #FFC400);
  color: #111;
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 10px 20px rgba(255,209,0,.22);
}
.file-upload-btn:hover{
  transform: translateY(-1px);
  background: linear-gradient(180deg, #FFE07A, #FFD100);
  box-shadow: 0 14px 28px rgba(255,209,0,.28);
}
.file-upload-btn:active{
  transform: translateY(0);
  opacity: .95;
}
.file-upload-btn:focus-visible{
  outline:none;
  box-shadow: 0 0 0 4px rgba(255,209,0,.35), 0 14px 28px rgba(255,209,0,.22);
}

/* .btn variants (keep) */
.btn{
  text-decoration: none;
  border: 1px solid transparent;
  min-height: var(--btn-h);
}
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: var(--beeline-yellow);
  color: #000;
  box-shadow: 0 10px 20px rgba(255,209,0,0.20);
}
.btn-primary:hover{ background: #e6c000; }

.btn-secondary{
  background: #fff;
  border-color: rgba(0,0,0,0.10);
  color: #111;
}
.btn-secondary:hover{ background: #fafafa; }

.btn-ghost{
  background: transparent;
  border-color: rgba(0,0,0,0.10);
  color: #111;
}
.btn-ghost:hover{ background: #f7f7f7; }

/* Preview */
.preview{
  margin-top: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(17,24,39,.14);
  background: rgba(0,0,0,.02);
  min-height: 140px;
  padding: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  position: relative;
  color: #777;
}
.preview img{
  max-width:100%;
  max-height: 220px;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,.08);
}

/* образец */
.preview.has-example::before{
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--example-img);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: .35;
  filter: grayscale(1);
}

/* текст поверх */
.preview .preview-hint{
  position: relative;
  z-index: 1;
  font-size: 13px;
  text-align: center;
  padding: 8px 12px;
  line-height: 1.4;
  color: rgba(17,24,39,.38);
  background: rgba(255,255,255,.32);
  border-radius: 10px;
}

/* Signature preview */
#signature-preview{
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,.02);
}
#signature-image{
  width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
}

/* Submit */
.submit-btn{
  margin-top: 18px;
  height: 54px;
  font-size: 16px;
  border-radius: 16px;
}

/* Tariff cards — modern */
.tariff-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.tariff-card{
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  padding: 14px;
  cursor:pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}
.tariff-card:hover{
  transform: translateY(-1px);
  border-color: rgba(255,209,0,.75);
  box-shadow: 0 16px 34px rgba(0,0,0,.08);
}
.tariff-card.selected{
  border-color: rgba(255,209,0,.95);
  box-shadow: 0 0 0 4px rgba(255,209,0,.22), 0 18px 35px rgba(0,0,0,.10);
}

.tariff-title{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.tariff-name{
  font-weight: 750;
  color: #111;
  line-height: 1.15;
  font-size: 15px;
}
.tariff-badge{
  font-size: 12px;
  font-weight: 650;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.05);
  color: #111;
}
.tariff-meta{ display:flex; flex-wrap:wrap; gap:8px; }
.tariff-chip{
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.06);
  color: #111;
}
.tariff-hint{
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* Modal */
.modal{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  z-index: 999;
  padding: 18px;
}
.modal-content{
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 30px 70px rgba(0,0,0,.25);
  max-width: 560px;
  margin: 7vh auto;
  padding: 18px;
  position: relative;
}
.close{
  position:absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.85);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color:#111;
  font-size: 22px;
  line-height: 1;
}
.close:hover{ box-shadow: 0 12px 24px rgba(0,0,0,.10); }

#signature-pad{
  width:100%;
  height: 220px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.03);
}

.modal-buttons{
  display:flex;
  gap: 10px;
  margin-top: 12px;
}
.modal-buttons button{ width: 100%; }

/* Small utilities */
strong{ color:#111; }
.notice{
  border-radius: 14px;
  padding: 14px 16px;
  margin: 14px 0 18px;
  border: 1px solid #eaeaea;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.notice-title{
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.notice-text{
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 6px;
  color: #222;
}
.notice-sub{ font-size: 13px; color: #666; }

.notice.warning{
  border-color: rgba(255,209,0,.55);
  background: linear-gradient(180deg, rgba(255,209,0,.18), rgba(255,209,0,.06));
}
.notice-info{
  background: #f7fbff;
  border-color: rgba(0,159,227,0.18);
}
.notice-warn{
  background: #fffaf0;
  border-color: rgba(255,209,0,0.35);
}

.form-warning{
  margin: 12px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,209,0,.15);
  border: 1px solid rgba(255,209,0,.5);
  font-size: 14px;
  line-height: 1.45;
}

/* ===== Modern page wrapper ===== */
.page{
  min-height: 100vh;
  background: var(--beeline-gray);
  padding: 28px 16px;
}

/* ===== Success page ===== */
.success-box{
  text-align: center;
  padding: 18px 10px 6px;
}

.page-title{
  margin: 10px 0 8px;
  font-size: 26px;
  line-height: 1.15;
  color: var(--beeline-black);
  letter-spacing: -0.2px;
}

.subtle{
  margin: 0 0 14px;
  color: #666;
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #0A66C2;
  font-weight: 700;
}

/* success badge spacing normalized (single definition) */
.success-badge{
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: #0b0b0b;
  background: rgba(255,209,0,0.55);
  box-shadow: 0 10px 24px rgba(255,209,0,0.22);
  margin: 12px auto;              /* одинаковый вертикальный отступ */
}

#request-id{
  margin: 12px 0 0;               /* как у галочки */
}

.success-list{
  text-align: left;
  margin: 12px 0 16px;
  padding-left: 18px;
  color: #333;
  font-size: 14px;
  line-height: 1.6;
}

.actions-stack{
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.footnote{
  margin-top: 14px;
  font-size: 13px;
  color: #777;
}

/* ===== Icon contact row ===== */
.contact-row{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
  margin: 14px 0 6px;
}
.contact-btn{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
  text-decoration: none;

  transition: transform .08s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease;
}
.contact-btn:hover{
  background: #fafafa;
  border-color: rgba(0,0,0,0.16);
  box-shadow: 0 14px 28px rgba(0,0,0,0.08);
}
.contact-btn:active{ transform: translateY(1px); }
.contact-btn svg{ width: 22px; height: 22px; display:block; }

/* ===== Actions row ===== */
.actions-row{
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.actions-row .btn{
  min-width: 220px;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 680px){
  .container{ margin: 14px auto; padding: 16px; }
  .tariff-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 520px){
  .consent-logo{ height: 34px; }
  .form-logo{ height: 32px; }
  .success-logo{ height: 32px; }

  /* Mobile: consent header — logo on top, titles centered (no absolute) */
  .consent-header{
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: auto;
    margin-bottom: 12px;
  }
  .consent-logo{
    margin: 0;
    width: auto;
  }
  .consent-titles{
    position: static;
    transform: none;
    text-align: center;
    pointer-events: auto;
    width: 100%;
  }
  .consent-titles h1{
    font-size: 20px;
    line-height: 1.15;
    margin: 0 0 4px;
    text-align: center;
  }
  .consent-titles h2{
    font-size: 13px;
    line-height: 1.25;
    margin: 0;
    text-align: center;
  }
}

@media (max-width: 420px){
  .contact-row{ flex-wrap: wrap; }
}

/* === FIX: Success header title goes too high === */

/* вертикальное центрирование заголовка внутри success-header */
.success-titles{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* было только X */
  width: calc(100% - 120px);        /* чтобы не наезжало на лого */
  padding: 0 8px;
  text-align: center;
  pointer-events: none;
}

.success-titles .page-title{
  margin: 0;           /* чтобы не “подпрыгивал” от маргинов */
  line-height: 1.15;
}

/* Mobile: делаем как на consent — без absolute, чтобы ничего не уезжало */
@media (max-width: 520px){
  .success-header{
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: auto;
    margin-bottom: 12px;
  }

  .success-logo{
    height: 32px;
    margin: 0;
  }

  .success-titles{
    position: static;
    transform: none;
    width: 100%;
    padding: 0;
    pointer-events: auto;
  }

  .success-titles .page-title{
    font-size: 20px; /* опционально, чтобы красиво помещалось */
    text-align: center;
  }
}
