@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f3f1eb;
  --bg-strong: #fff6c8;
  --ink: #1d1d1d;
  --ink-soft: #3b3b3c;
  --muted: #6e7277;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-dark: #242426;
  --line: rgba(29, 29, 29, 0.1);
  --accent: #d1223f;
  --accent-strong: #bd0826;
  --accent-soft: #ffbc7d;
  --error: #bd0826;
  --success: #2f7d4a;
  --shadow: 0 24px 64px rgba(29, 29, 29, 0.12);
  --radius-xl: 28px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(209, 34, 63, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 188, 125, 0.24), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 62%, #ebe8df 100%);
}

.shell {
  width: min(1040px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.shell-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 0;
}

.hero {
  padding: 1.25rem 0 2rem;
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 188, 125, 0.18), transparent 38%),
    linear-gradient(135deg, var(--panel-dark) 0%, #151517 100%);
  border-radius: var(--radius-xl);
  z-index: -1;
}

.hero {
  position: relative;
  padding: 1.6rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h1 {
  max-width: 11ch;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 0.98;
}

.lede {
  max-width: 60ch;
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.04rem;
  line-height: 1.7;
  font-weight: 500;
}

.panel {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.result-panel {
  overflow: hidden;
}

.login-card {
  width: min(520px, 100%);
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.client-form label,
.section-head span,
.hint,
th,
.empty,
.message {
  font-family: "Montserrat", "Segoe UI", sans-serif;
}

.login-form {
  display: grid;
  gap: 0.9rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

input {
  flex: 1;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 1rem;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
.config-output:focus {
  outline: none;
  border-color: rgba(209, 34, 63, 0.45);
  box-shadow: 0 0 0 4px rgba(209, 34, 63, 0.1);
}

button {
  border: 0;
  border-radius: 14px;
  padding: 0 1.3rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  font-size: 1rem;
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 14px 32px rgba(189, 8, 38, 0.22);
}

button:hover,
.download-link:hover {
  transform: translateY(-1px);
  filter: saturate(1.03);
}

.secondary-button {
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

.danger-button {
  min-height: 40px;
  padding: 0.7rem 0.95rem;
  background: linear-gradient(135deg, #d1223f 0%, #8f1026 100%);
}

.login-button {
  min-height: 48px;
  margin-top: 0.5rem;
}

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(209, 34, 63, 0.1);
  color: var(--accent-strong);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: none;
}

.hint {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.messages {
  margin-top: 1rem;
}

.message {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 600;
}

.message.error {
  color: var(--error);
  background: rgba(189, 8, 38, 0.08);
  border-color: rgba(189, 8, 38, 0.12);
}

.message.success {
  color: var(--success);
  background: rgba(22, 101, 52, 0.08);
  border-color: rgba(47, 125, 74, 0.12);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head span {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.result-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.qr-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 246, 200, 0.42) 0%, rgba(255, 255, 255, 0.85) 100%);
}

.qr-image {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  border-radius: 12px;
}

.config-output {
  width: 100%;
  min-height: 320px;
  margin-top: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  resize: vertical;
  background: #fff;
  color: var(--ink);
  font: 0.93rem/1.6 "Consolas", "Courier New", monospace;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: rgba(209, 34, 63, 0.1);
  color: var(--accent-strong);
  font: 700 0.78rem "Montserrat", "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge.muted {
  background: rgba(29, 29, 29, 0.08);
  color: var(--muted);
}

.mono {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 800;
}

tbody tr {
  transition: background-color 0.18s ease;
}

tbody tr:hover {
  background: rgba(255, 246, 200, 0.3);
}

.empty {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.login-title {
  max-width: none;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.login-card .lede {
  color: var(--ink-soft);
}

.login-card .eyebrow {
  color: var(--accent);
}

.login-card {
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent-soft));
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 1rem, 1040px);
    padding-top: 1.5rem;
  }

  .panel {
    padding: 1.1rem;
    border-radius: 22px;
  }

  .form-row {
    flex-direction: column;
  }

  button {
    padding: 0.95rem 1rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

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

  .hero {
    padding: 1.2rem;
  }
}
