:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #6d7485;
  --line: #e6e8ee;
  --surface: rgba(255, 255, 255, 0.94);
  --brand: #f85606;
  --brand-dark: #d94400;
  --brand-soft: #fff0e8;
  --success: #148a5b;
  --warning: #a65808;
  --danger: #c53b3b;
  --shadow: 0 24px 70px rgba(41, 46, 69, 0.11);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #f5f6f9; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(248, 86, 6, 0.12), transparent 29rem),
    linear-gradient(180deg, #fafbfc 0, #f4f5f8 100%);
  font-family: Poppins, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(16px);
  pointer-events: none;
}

.ambient-one { width: 22rem; height: 22rem; top: 28%; right: -10rem; background: rgba(255, 157, 98, 0.12); }
.ambient-two { width: 18rem; height: 18rem; bottom: -8rem; left: -7rem; background: rgba(249, 194, 78, 0.1); }

.studio-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 13px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(224, 226, 234, 0.88);
  background: rgba(250, 251, 252, 0.86);
  backdrop-filter: blur(18px);
}

.brand, .back-link {
  color: inherit;
  text-decoration: none;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark, .section-icon {
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #ff7437, var(--brand));
  box-shadow: 0 10px 25px rgba(248, 86, 6, 0.25);
}
.brand-mark { width: 44px; height: 44px; border-radius: 14px; font-size: 18px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -0.02em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.security-pill, .back-link, .account-chip, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.security-pill { padding: 8px 11px; color: #356b55; background: #e9f7f0; }
.back-link { padding: 9px 12px; border: 1px solid var(--line); background: white; transition: .2s ease; }
.back-link:hover { border-color: #cfd2dc; transform: translateY(-1px); }

.studio-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 80px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 38px;
  align-items: end;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 13px; font-size: clamp(34px, 5vw, 58px); line-height: 1.04; letter-spacing: -0.055em; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -0.035em; }
.hero-copy { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }

.live-warning {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 17px;
  border: 1px solid #ffd5bd;
  border-radius: 18px;
  color: #76300f;
  background: linear-gradient(135deg, #fff8f4, #fff0e6);
}
.live-warning > i { margin-top: 3px; color: var(--brand); }
.live-warning strong, .live-warning span { display: block; }
.live-warning strong { margin-bottom: 3px; font-size: 13px; }
.live-warning span { color: #945135; font-size: 11px; line-height: 1.55; }

.auth-card, .builder-card, .summary-card, .results-card {
  border: 1px solid rgba(226, 228, 235, 0.92);
  border-radius: 25px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.3fr); gap: 30px; padding: 28px; }
.auth-copy { display: flex; gap: 15px; align-items: flex-start; }
.section-icon { flex: 0 0 auto; width: 43px; height: 43px; border-radius: 14px; }
.auth-copy p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.login-form label, .input-field { color: #4b5261; font-size: 11px; font-weight: 700; }
.login-form input, .input-field > input, .money-input {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  border: 1px solid #dfe1e8;
  border-radius: 13px;
  outline: none;
  background: #fbfbfc;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.login-form input, .input-field > input { padding: 0 14px; }
.login-form input:focus, .input-field > input:focus, .money-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(248, 86, 6, 0.1); background: white; }
.primary-button, .secondary-button, .create-button, .copy-button, .open-button {
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.primary-button { min-height: 48px; padding: 0 18px; border-radius: 13px; color: white; background: var(--ink); font-weight: 700; }
.primary-button:hover, .create-button:hover { transform: translateY(-1px); }
.inline-message { grid-column: 1 / -1; margin: 0; color: var(--danger); font-size: 12px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); gap: 22px; align-items: start; }
.builder-card { padding: clamp(22px, 3vw, 34px); }
.section-heading { display: flex; gap: 14px; align-items: center; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.section-heading .account-chip { margin-left: auto; max-width: 190px; overflow: hidden; padding: 7px 10px; color: #596072; background: #f1f2f5; text-overflow: ellipsis; white-space: nowrap; }

.field-group { min-width: 0; margin: 0; padding: 26px 0; border: 0; border-bottom: 1px solid var(--line); }
.field-group legend { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: #303747; font-size: 13px; font-weight: 800; }
.field-group legend > span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 9px; color: var(--brand-dark); background: var(--brand-soft); font-size: 11px; }

.shop-options { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; }
.shop-option { position: relative; display: flex; min-height: 92px; gap: 10px; align-items: center; padding: 14px; border: 1px solid #dfe1e8; border-radius: 16px; cursor: pointer; background: #fbfbfc; }
.shop-option input, .duration-options input { position: absolute; opacity: 0; pointer-events: none; }
.radio-check { display: grid; place-items: center; flex: 0 0 23px; width: 23px; height: 23px; border: 1.5px solid #c7cad3; border-radius: 50%; color: transparent; background: white; font-size: 9px; }
.shop-option strong, .shop-option small { display: block; }
.shop-option strong { font-size: 12px; }
.shop-option small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.shop-option em { position: absolute; top: 8px; right: 8px; padding: 4px 6px; border-radius: 999px; color: #a44312; background: #fff0e6; font-size: 7px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.shop-option:has(input:checked) { border-color: var(--brand); background: #fffaf7; box-shadow: inset 0 0 0 1px var(--brand); }
.shop-option:has(input:checked) .radio-check { border-color: var(--brand); color: white; background: var(--brand); }

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.input-field { display: block; }
.input-field small { display: block; margin-top: 7px; color: #858b99; font-size: 9px; font-weight: 500; }
.money-input { display: flex; align-items: center; overflow: hidden; }
.money-input b { align-self: stretch; display: grid; place-items: center; padding: 0 13px; border-right: 1px solid #e2e4e9; color: var(--brand-dark); background: #fff4ee; font-size: 10px; }
.money-input input { min-width: 0; flex: 1; height: 46px; padding: 0 13px; border: 0; outline: 0; background: transparent; }

.compact-group { border-bottom: 0; }
.duration-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duration-options label { position: relative; cursor: pointer; }
.duration-options span { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px; border: 1px solid #dfe1e8; border-radius: 14px; background: #fbfbfc; }
.duration-options strong { font-size: 12px; }
.duration-options small { color: var(--muted); font-size: 10px; }
.duration-options input:checked + span { border-color: var(--brand); color: var(--brand-dark); background: #fff7f2; box-shadow: inset 0 0 0 1px var(--brand); }

.form-error { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #fac7c7; border-radius: 12px; color: #9f3030; background: #fff2f2; font-size: 11px; }
.create-button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 58px; padding: 0 20px; border-radius: 16px; color: white; background: linear-gradient(135deg, #ff6e2d, var(--brand)); box-shadow: 0 16px 32px rgba(248, 86, 6, 0.24); font-size: 13px; font-weight: 800; }
.create-button span { display: inline-flex; align-items: center; gap: 9px; }
button:disabled { cursor: not-allowed; opacity: .56; transform: none !important; }

.summary-column { position: sticky; top: 98px; display: grid; gap: 16px; }
.summary-card { padding: 26px; }
.voucher-preview { position: relative; overflow: hidden; margin: 20px 0; padding: 20px; border-radius: 20px; color: white; background: linear-gradient(135deg, #171a24, #2d2832 65%, #71341e); box-shadow: 0 20px 45px rgba(27, 24, 35, 0.2); }
.voucher-preview::after { content: ""; position: absolute; width: 120px; height: 120px; top: -55px; right: -25px; border-radius: 50%; background: rgba(248, 86, 6, .65); filter: blur(2px); }
.voucher-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; }
.voucher-logo { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--brand); font-weight: 900; }
.voucher-value { position: relative; z-index: 1; display: flex; gap: 7px; align-items: baseline; margin: 24px 0 5px; }
.voucher-value strong { font-size: 27px; letter-spacing: -0.05em; }
.voucher-value span { color: #ffb28b; font-size: 11px; font-weight: 900; }
.voucher-preview p { position: relative; z-index: 1; margin: 0; color: #c9c8cf; font-size: 9px; }
.voucher-cut { position: absolute; width: 20px; height: 20px; right: -10px; bottom: 28px; border-radius: 50%; background: white; }
.summary-list { display: grid; gap: 0; margin: 0; }
.summary-list div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid #eff0f3; }
.summary-list div:last-child { border-bottom: 0; }
.summary-list dt { color: var(--muted); font-size: 10px; }
.summary-list dd { margin: 0; text-align: right; font-size: 10px; font-weight: 800; }

.safety-card { display: flex; gap: 13px; padding: 17px; border: 1px solid #d9eee5; border-radius: 19px; color: #245b43; background: rgba(239, 250, 245, .9); }
.safety-card > i { margin-top: 3px; }
.safety-card strong { font-size: 11px; }
.safety-card p { margin: 5px 0 0; color: #5c7e6e; font-size: 9px; line-height: 1.55; }

.results-card { grid-column: 1 / -1; padding: clamp(22px, 3vw, 32px); }
.results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.results-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.status-badge { padding: 8px 11px; color: #7d5500; background: #fff4d7; text-transform: capitalize; }
.status-badge.success { color: #176a49; background: #e8f7f0; }
.status-badge.error { color: #9d3434; background: #fdecec; }
.progress-track { overflow: hidden; height: 7px; margin: 22px 0 10px; border-radius: 999px; background: #eef0f3; }
.progress-track span { display: block; width: 3%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #ff9b69); transition: width .35s ease; }
.progress-copy { margin-bottom: 17px; color: var(--muted); font-size: 10px; }
.result-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.result-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid #e5e7ec; border-radius: 16px; background: #fafbfc; }
.result-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--brand-dark); background: var(--brand-soft); font-size: 10px; font-weight: 900; }
.result-item strong, .result-item small { display: block; }
.result-item strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.result-item small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.result-item.failed { border-color: #f1caca; background: #fff8f8; }
.result-item.failed .result-number { color: #a33232; background: #fdeaea; }
.result-actions { display: flex; gap: 6px; }
.copy-button, .open-button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #4e5565; background: white; box-shadow: 0 4px 12px rgba(27, 34, 52, .08); }
.open-button { color: white; background: var(--brand); text-decoration: none; }
.results-actions { display: flex; gap: 9px; margin-top: 18px; }
.secondary-button { min-height: 40px; padding: 0 14px; border: 1px solid #dde0e7; border-radius: 12px; color: #414858; background: white; font-size: 10px; font-weight: 800; }
.secondary-button i { margin-right: 6px; }
.retry-button { color: white; border-color: var(--brand); background: var(--brand); }

.toast { position: fixed; z-index: 40; right: 20px; bottom: 20px; max-width: min(350px, calc(100vw - 40px)); padding: 12px 15px; border-radius: 13px; color: white; background: #202634; box-shadow: 0 14px 35px rgba(26, 31, 43, .24); font-size: 10px; font-weight: 700; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .workspace { grid-template-columns: 1fr; }
  .summary-column { position: static; grid-row: 2; }
  .results-card { grid-column: 1; }
  .auth-card { grid-template-columns: 1fr; }
  .shop-options { grid-template-columns: 1fr; }
  .shop-option { min-height: 76px; }
}

@media (max-width: 640px) {
  .studio-header { min-height: 67px; padding: 10px 15px; }
  .brand-mark { width: 39px; height: 39px; border-radius: 12px; }
  .brand strong { font-size: 14px; }
  .security-pill { display: none; }
  .back-link { padding: 8px 10px; font-size: 0; }
  .back-link i { font-size: 12px; }
  .studio-shell { width: min(100% - 24px, 1180px); padding: 35px 0 60px; }
  h1 { font-size: 37px; }
  .hero-copy { font-size: 13px; }
  .builder-card, .summary-card, .results-card, .auth-card { border-radius: 20px; }
  .auth-card { padding: 20px; }
  .login-form, .input-grid, .result-list { grid-template-columns: 1fr; }
  .login-form .primary-button { min-height: 48px; }
  .section-heading { align-items: flex-start; }
  .section-heading .account-chip { display: none; }
  .duration-options { grid-template-columns: 1fr; }
  .results-heading { display: grid; }
  .status-badge { justify-self: start; }
}

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