* {
  box-sizing: border-box;
}

:root {
  --bg: #000000;
  --panel: #0a0a0a;
  --panel-2: #111111;
  --field: #1a1a1a;
  --field-border: #5d5549;
  --border: rgba(255, 255, 255, 0.12);
  --text: #f5f5f5;
  --muted: #b7b7b7;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.03), transparent 32%),
    #000;
  color: var(--text);
}

.topbar {
  height: 88px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: #f5f5f5;
  display: inline-flex;
}

.brand-icon svg,
.icon-button svg,
.btn-icon svg {
  width: 100%;
  height: 100%;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: #f3f3f3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page {
  padding: 8px 24px 40px;
  display: flex;
  justify-content: center;
}

.panel {
  width: min(100%, 948px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  box-shadow: var(--shadow);
  padding: 32px;
  margin-top: 34px;
}

.form-panel, .result-panel {
  width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 32px;
}

.field label,
.key-card label {
  display: block;
  font-size: 15px;
  margin-bottom: 10px;
  color: #f0f0f0;
  font-weight: 500;
}

.field input,
.field select,
.key-card textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--field-border);
  background: #1c1c1c;
  color: var(--text);
  padding: 15px 16px;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.field input::placeholder {
  color: #8d8d8d;
}

.field input:focus,
.field select:focus,
.key-card textarea:focus {
  border-color: #8d8475;
  background: #202020;
}

.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #d7d7d7 50%),
    linear-gradient(135deg, #d7d7d7 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.generate-button,
.utility-button {
  width: 100%;
  margin-top: 34px;
  height: 56px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #242424, #101010);
  color: #ffffff;
  font: inherit;
  font-size: 20px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.generate-button:hover,
.utility-button:hover {
  filter: brightness(1.08);
}

.generate-button:disabled,
.utility-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
}

.result-panel h2 {
  margin: 0 0 18px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.result-panel .subtext {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.key-list {
  display: grid;
  gap: 18px;
}

.key-card {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.025);
  padding: 16px;
}

.key-card textarea {
  min-height: 196px;
  resize: vertical;
  line-height: 1.42;
  background: #101010;
}

.card-actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-button {
  border: 1px solid rgba(255,255,255,0.14);
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

.action-button:hover {
  background: #181818;
}

.footer-action {
  margin-top: 18px;
}

.notice {
  margin-top: 14px;
  color: #bcbcbc;
  font-size: 13px;
}

.error {
  margin-top: 16px;
  color: #f0c8c8;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
}

@media (max-width: 860px) {
  .topbar {
    padding: 0 22px;
    height: 76px;
  }

  .brand {
    font-size: 20px;
  }

  .panel {
    margin-top: 20px;
    padding: 22px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .generate-button,
  .utility-button {
    height: 54px;
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 0 12px 24px;
  }

  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  .field input,
  .field select,
  .key-card textarea {
    border-radius: 12px;
  }

  .card-actions {
    flex-direction: column;
  }

  .action-button {
    width: 100%;
  }
}
