/* appeal-static/styles.css — real responsive website, rebuilt from scratch */

@font-face{font-family:'Geist';src:url('fonts/geist/Geist-Regular.ttf') format('truetype');font-weight:400;font-display:swap;}
@font-face{font-family:'Geist';src:url('fonts/geist/Geist-Medium.ttf') format('truetype');font-weight:500;font-display:swap;}
@font-face{font-family:'Geist';src:url('fonts/geist/Geist-Bold.ttf') format('truetype');font-weight:700;font-display:swap;}
@font-face{font-family:'Oswald';src:url('fonts/oswald/Oswald-Regular.ttf') format('truetype');font-weight:400;font-display:swap;}
@font-face{font-family:'Oswald';src:url('fonts/oswald/Oswald-Medium.ttf') format('truetype');font-weight:500;font-display:swap;}
@font-face{font-family:'Oswald';src:url('fonts/oswald/Oswald-Bold.ttf') format('truetype');font-weight:700;font-display:swap;}

:root {
  --p900: #2A1545;
  --p800: #3D1E63;
  --p700: #5B2C91;
  --p600: #6C34A8;
  --p500: #7C3AED;
  --p200: #D8C7F0;
  --p100: #F1EAFB;
  --p50:  #FAF7FE;
  --ink:  #221830;
  --muted:#6B6478;
  --line: #E8E2F0;
  --white:#ffffff;
  --ok:   #0E9F6E;
  --work: #D97706;
  --danger:#DC2626;
  --r: 16px;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Geist', system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 130% 55% at 8% 0%,   #EDE7F6 0%, transparent 55%),
    radial-gradient(ellipse 110% 55% at 92% 100%, #EFE9F6 0%, transparent 55%),
    #F0EDF5;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== SITE HEADER ===== */
.site-header {
  background: var(--p700);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(43,21,69,.35);
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; cursor: pointer; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  letter-spacing: -.5px;
  line-height: 1;
}

.brand-sub {
  font-size: 10px;
  font-weight: 700;
  color: #D9C5F2;
  letter-spacing: .5px;
  text-transform: uppercase;
  line-height: 1.35;
}

/* Language toggle */
.lang-toggle { display: flex; gap: 4px; }

.lang-btn {
  border: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .15s, color .15s;
}

.lang-btn.active  { background: rgba(255,255,255,.24); color: #fff; }
.lang-btn:not(.active) { background: rgba(255,255,255,.10); color: rgba(255,255,255,.7); }
.lang-btn:hover:not(.active) { background: rgba(255,255,255,.17); color: #fff; }

/* ===== MAIN CONTAINER ===== */
.main-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ===== SCREENS ===== */
.screen { display: none; }

.screen.active {
  display: block;
  animation: fadeIn .28s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ===== HOME SCREEN (Figma redesign) ===== */
/* The purple top bar is replaced by the wordmark header on the home screen. */
body[data-screen="home"] .site-header { display: none; }

/* Figma background: pure white with a faint #F3F4F6 wave-line texture. */
body[data-screen="home"] { background: #ffffff; }
body[data-screen="home"]::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('img/wave.svg') 0 0 / 100% 22px repeat;
  pointer-events: none;
  z-index: 0;
}
#screen-home { position: relative; z-index: 1; }
/* Fill the viewport so the "go to site" link sits at the bottom (Figma). */
#screen-home.active { display: flex; flex-direction: column; min-height: 100vh; }

/* Top banner — dark purple gradient with a bright glow upper-right (Figma). */
.home-head {
  position: relative;
  text-align: center;
  margin: 0 -24px;                 /* full-bleed within .main-wrap */
  padding: 54px 24px 36px;
  background:
    radial-gradient(ellipse 85% 130% at 86% 0%, rgba(124,58,237,.60) 0%, rgba(124,58,237,0) 55%),
    linear-gradient(155deg, #2A1545 0%, #1B1235 100%);
  box-shadow: 0 6px 20px -10px rgba(27,18,53,.55);
}

/* RU/KZ toggle — white-on-dark style for the purple banner. */
.home-lang { position: absolute; top: 12px; right: 24px; }
.home-lang .lang-btn.active            { background: rgba(255,255,255,.24); color: #fff; }
.home-lang .lang-btn:not(.active)      { background: rgba(255,255,255,.12); color: rgba(255,255,255,.75); }
.home-lang .lang-btn:hover:not(.active){ background: rgba(255,255,255,.18); color: #fff; }

.home-wordmark { display: block; height: 44px; width: auto; margin: 14px auto 16px; }

.home-sub {
  font-size: 15px;
  font-weight: 500;               /* Medium, like the design */
  color: rgba(255,255,255,.92);   /* white subtitle on the purple banner */
  line-height: 1.5;
  max-width: 290px;
  margin: 0 auto;
}

.home-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 0 40px;
}

.hcard {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 128px;
  padding: 16px;                       /* Figma: 16px on all sides */
  display: flex;                       /* title at top, arrow at bottom */
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  border: 1px solid #F3F4F6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 -1px 14px rgba(19,28,52,.10), 0 10px 26px -18px rgba(19,28,52,.22);
  cursor: pointer;
  text-align: left;
  outline: none;
  transition: transform .15s, box-shadow .15s;
}

.hcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 -1px 14px rgba(19,28,52,.10), 0 16px 32px -14px rgba(124,58,237,.32);
}

.hcard:focus-visible { box-shadow: 0 0 0 3px var(--p200); }

.hcard-glow {
  position: absolute;
  top: -40px;
  right: -30px;
  width: 220px;
  height: 200px;
  background: radial-gradient(circle at 68% 42%, rgba(193,135,255,.45), rgba(193,135,255,0) 62%);
  pointer-events: none;
}

.hcard-icon {
  position: absolute;
  top: 50%;
  right: -4px;                         /* slight overflow past the right edge */
  transform: translateY(-50%);
  width: 168px;
  height: auto;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.hcard-icon-bulb {
  width: 134px;
  right: 8px;
  transform: translateY(-50%) rotate(4.6deg);
}

.hcard-title {
  position: relative;                  /* above the icon/glow */
  max-width: 220px;
  font-family: var(--font-display);    /* Oswald — same brand font as the landing */
  font-weight: 500;
  font-size: 17px;
  line-height: 1.2;
  color: #101828;
}

.hcard-arrow {
  position: relative;                  /* flows to the bottom-left via space-between */
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #101828;                      /* Figma: dark chevron, not purple */
}

/* "Перейти на сайт" — centered text link pinned to the bottom of the home screen. */
.home-site-link {
  margin: auto auto 18px;          /* margin-top:auto pushes it to the bottom */
  padding: 14px 24px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: #101828;
  text-decoration: none;
  border-radius: 12px;
  transition: background .15s, color .15s;
}
.home-site-link:hover { background: var(--p50); color: var(--p700); }
.home-site-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--p200); }

/* ===== HOME — desktop polish (≥ 760px only; mobile untouched) ===== */
@media (min-width: 760px) {
  body[data-screen="home"] .main-wrap { max-width: 640px; }

  #screen-home { padding: 48px 0 64px; }

  /* Banner becomes a contained, rounded card floating on the white page. */
  .home-head {
    margin: 0;
    border-radius: 24px;
    padding: 56px 36px 42px;
    box-shadow: 0 20px 54px -24px rgba(27,18,53,.55);
  }
  .home-wordmark { height: 50px; }

  .home-cards { padding-top: 28px; gap: 18px; }
  .hcard { min-height: 150px; padding: 22px; }   /* arrow auto-pins bottom-left */
  .hcard-title { font-size: 18px; max-width: 260px; }
  .hcard-icon { width: 188px; }
  .hcard-icon-bulb { width: 152px; }
}

.site-foot {
  text-align: center;
  padding: 22px 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px solid var(--line);
}

/* ===== FORM SCREEN ===== */
.screen-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 0 22px;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: var(--p100);
  color: var(--p700);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background .15s;
  outline: none;
}

.back-btn:hover         { background: var(--p200); }
.back-btn:focus-visible { box-shadow: 0 0 0 3px var(--p200); }

.screen-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--p900);
  letter-spacing: -.3px;
}

/* Form cards */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px -6px rgba(43,21,69,.16);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.card-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--p900);
  line-height: 1.2;
}

/* Fields */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--p900);
  margin-bottom: 8px;
}

.label .req { color: var(--danger); margin-left: 2px; }
.label .opt { color: var(--muted); font-weight: 500; font-size: 12px; }

.input,
.select,
.textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  transition: border .15s, box-shadow .15s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--p500);
  box-shadow: 0 0 0 3px var(--p100);
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6478' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 40px;
  cursor: pointer;
}

.select:disabled {
  background-color: #F8F6FC;
  color: var(--muted);
  cursor: not-allowed;
  opacity: .85;
}

.textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.55;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.4;
}

.field-hint.error { color: var(--danger); }

.field-counter {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
  text-align: right;
  font-weight: 500;
}

.field-counter.warn  { color: var(--work); }
.field-counter.limit { color: var(--danger); }

/* Upload drop zone */
.drop-zone {
  border: 2px dashed var(--p200);
  border-radius: 14px;
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  background: var(--p50);
  transition: border .15s, background .15s;
  line-height: 1.5;
}

.drop-zone:hover { border-color: var(--p500); background: var(--p100); }

.drop-zone strong {
  color: var(--p700);
  display: block;
  margin-top: 10px;
  font-size: 14px;
}

/* Checkbox */
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
}

.check input { position: absolute; opacity: 0; pointer-events: none; }

.check .box {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--p200);
  background: #fff;
  display: grid;
  place-items: center;
  transition: background .15s, border-color .15s;
  margin-top: 1px;
}

.check input:checked + .box { background: var(--p700); border-color: var(--p700); }
.check input:checked + .box svg { opacity: 1; }
.check .box svg { opacity: 0; transition: opacity .15s; }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--p200); }

/* Buttons */
.btn {
  width: 100%;
  border: 0;
  border-radius: 40px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform .12s, box-shadow .15s, background .15s, opacity .15s;
  text-decoration: none;
  outline: none;
}

.btn:active { transform: scale(.985); }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--p200); }

.btn-primary {
  background: var(--p700);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(91,44,145,.62);
}

.btn-primary:hover { background: var(--p600); }

.btn-primary:disabled {
  background: #C9C0D8;
  box-shadow: none;
  cursor: not-allowed;
  opacity: .75;
  color: #fff;
}

.btn-secondary {
  background: var(--white);
  color: var(--p700);
  border: 1.5px solid var(--p200);
}

.btn-secondary:hover { background: var(--p50); border-color: var(--p500); }

/* Submit zone */
.submit-zone { margin-top: 8px; }
.submit-zone .check { margin-bottom: 20px; }

/* ===== SIGN SCREEN ===== */
.sign-back { padding: 22px 0 0; }

.sign-wrap {
  padding: 26px 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.egov-logo-box {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0055A5, #003D7A);
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px -8px rgba(0,60,120,.52);
}

.egov-logo-box svg { color: #fff; }

.sign-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--p900);
  margin-bottom: 12px;
  line-height: 1.25;
}

.sign-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 30px;
  max-width: 460px;
}

.sign-actions {
  width: 100%;
  max-width: 400px;
}

.sign-qr-wrap { margin: 24px 0 0; }

.sign-qr-wrap > p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

#sign-qr-canvas {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 20px -8px rgba(43,21,69,.25);
}

#sign-qr-canvas canvas { display: block; }

.sign-progress {
  width: 100%;
  max-width: 400px;
  margin: 28px auto 10px;
  background: var(--p100);
  border-radius: 30px;
  height: 6px;
  overflow: hidden;
}

.sign-bar {
  height: 6px;
  border-radius: 30px;
  background: linear-gradient(90deg, #0055A5, #7C3AED);
  width: 0;
  transition: width 2.5s ease;
}

.sign-status {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

/* ===== SUCCESS SCREEN ===== */
.success-wrap {
  padding: 64px 0 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.success-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--p100);
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  animation: pop .5s cubic-bezier(.34,1.5,.5,1) both;
}

@keyframes pop {
  from { transform: scale(.4); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.success-ring svg { color: var(--ok); }

.success-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--p900);
  margin-bottom: 12px;
  line-height: 1.2;
}

.success-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 34px;
  max-width: 440px;
}

.success-ticket {
  background: var(--p700);
  color: #fff;
  border-radius: 16px;
  padding: 18px 24px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 12px;
  text-align: left;
}

.success-ticket small {
  font-size: 11px;
  color: #D9C5F2;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  display: block;
}

.success-ticket b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 1px;
  display: block;
  margin-top: 6px;
  color: #fff;
}

.success-info {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  text-align: left;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row b    { color: var(--p900); font-family: var(--font-body); }

.success-note {
  background: var(--p50);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  width: 100%;
  max-width: 400px;
  text-align: left;
  margin-bottom: 28px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.success-note svg { flex: 0 0 auto; color: var(--p500); margin-top: 2px; }

.success-wrap .btn { max-width: 400px; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  bottom: 24px;
  background: var(--p900);
  color: #fff;
  padding: 13px 20px;
  border-radius: 13px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  display: flex;
  gap: 9px;
  align-items: center;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  white-space: nowrap;
  max-width: calc(100vw - 48px);
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .main-wrap      { padding: 0 16px 48px; }
  .header-inner   { padding: 0 16px; }
  .hero           { padding: 36px 0 28px; }
  .hero-title     { font-size: 22px; }
  .hero-sub       { font-size: 14px; }
  .option-card    { padding: 18px; }
  .oc-icon        { flex: 0 0 48px; height: 48px; border-radius: 14px; }
  .form-card      { padding: 18px 16px; }
  .screen-header h2 { font-size: 18px; }
  .sign-title     { font-size: 18px; }
  .success-title  { font-size: 19px; }
  .brand-sub      { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
