:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #64748b;
  --line: #d9e0e8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --ok: #16794c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.panel,
.workspace {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.auth-panel {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 420px);
  gap: 40px;
  align-items: end;
  padding: 40px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 42px;
  line-height: 1.1;
}

h2 {
  font-size: 34px;
  line-height: 1.15;
}

.summary,
.hint,
.notice,
#smsText {
  color: var(--muted);
}

.summary {
  margin: 16px 0 0;
  max-width: 520px;
  line-height: 1.7;
}

.card-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

button:disabled {
  background: #a8b3bf;
  cursor: not-allowed;
}

.hint {
  margin: 10px 0 0;
  font-size: 14px;
}

.workspace {
  margin-top: 24px;
  padding: 32px;
}

.hidden {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.copy-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.copy-line h2,
.code-box strong {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.copy-line .copy-btn {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  white-space: nowrap;
}

.copy-btn {
  min-height: 34px;
  padding: 0 12px;
  background: #e2e8f0;
  color: #1f2937;
  font-size: 14px;
}

.copy-btn:hover:not(:disabled) {
  background: #cbd5e1;
}

.copy-btn.copied,
.copy-btn.copied:hover:not(:disabled) {
  background: #dcfce7;
  color: #15803d;
}

.copy-btn:disabled {
  background: #eef2f6;
  color: #94a3b8;
}

.clipboard-fallback {
  position: fixed;
  left: -9999px;
  top: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #e8f6f2;
  color: var(--ok);
  font-weight: 700;
  white-space: nowrap;
}

.badge.waiting {
  background: #fff7df;
  color: #986100;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric span,
.code-box span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.manual-refresh-row,
.expire-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.manual-refresh-row strong,
.expire-row strong {
  margin-top: 0;
  min-width: 0;
}

.refresh-inline-btn,
.new-number-btn {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.code-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #fbfcfd;
}

.code-box strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  letter-spacing: 0;
}

#smsText {
  min-height: 22px;
  margin: 10px 0 0;
  line-height: 1.6;
}

.notice {
  min-height: 24px;
  margin: 18px 0 0;
  line-height: 1.6;
}

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 960px);
    padding: 24px 0;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 28px;
  }

  .form-row,
  .metrics {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 22px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
