:root {
  --bg: #090a0f;
  --surface-1: #0e1017;
  --surface-2: #131620;
  --surface-3: #1a1e2b;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --text: #eceef5;
  --text-2: #b4bacd;
  --muted: #7d859b;
  --accent: #4f8eff;
  --accent-2: #7cb3ff;
  --accent-soft: rgba(79, 142, 255, .14);
  --good: #3dd68c;
  --bad: #f2555a;
  --r-md: 14px;
  --r-lg: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

.logo { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #34343f, #1d1d27); border: 1.5px solid rgba(79, 142, 255, .7); display: grid; place-items: center; }
.logo-mark svg { width: 14px; height: 14px; }
.logo-name { font-weight: 700; font-size: 16px; }
.logo-img { display: block; height: 30px; width: auto; }

h1 { font-size: 20px; margin: 0 0 4px; }
p.sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; line-height: 1.5; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 6px; line-height: 1.4; }

select, input {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
select:focus, input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }

.durations { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.duration-opt {
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  text-align: center;
  background: var(--surface-3);
  transition: border-color .15s, background .15s;
}
.duration-opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.duration-opt .label { font-weight: 650; font-size: 13px; }
.duration-opt .price { color: var(--accent-2); font-weight: 700; font-size: 15px; margin-top: 2px; }

button.pay, a.pay {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(79, 142, 255, .25);
}
button.pay:disabled { opacity: .5; cursor: not-allowed; }

.error { color: var(--bad); font-size: 13px; margin-top: 12px; display: none; }
.error.show { display: block; }

.status-box { text-align: center; padding: 20px 0; }
.status-box .spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); margin: 0 auto 16px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-box .code { font-family: ui-monospace, monospace; font-size: 22px; font-weight: 700; letter-spacing: .04em; background: var(--surface-3); border-radius: 10px; padding: 14px; margin: 16px 0; color: var(--good); }
.status-box .muted { color: var(--muted); font-size: 13px; }

.hidden { display: none !important; }

/* Former inline styles: the backend's content security policy (style-src 'self') strips style="" attributes on
   the API domains, which is exactly where the TV's renewal QR opens this page. */
.opt { font-weight: 400; color: var(--muted); }
.status-title { font-size: 16px; }
.status-title.good { color: var(--good); }
.status-title.bad { color: var(--bad); }
.pay-link { display: block; box-sizing: border-box; margin-top: 16px; text-align: center; text-decoration: none; }
