:root {
  --bg: #f7f0e7;
  --bg-accent: #d9ebe8;
  --paper: rgba(255, 255, 255, 0.84);
  --paper-strong: #fffdfa;
  --ink: #1f2d2b;
  --muted: #61716f;
  --line: rgba(31, 45, 43, 0.14);
  --primary: #6a3fb3;
  --primary-dark: #4b2c86;
  --primary-soft: #e5daf6;
  --accent: #f3d9cd;
  --accent-soft: #fff1eb;
  --danger: #8c2f39;
  --danger-soft: #f7e3e6;
  --shadow: 0 18px 40px rgba(31, 56, 51, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(215, 238, 240, 0.98), transparent 34%),
    radial-gradient(circle at top right, rgba(243, 217, 205, 0.9), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(228, 239, 225, 0.7), transparent 28%),
    linear-gradient(180deg, var(--bg), #f7f5f0);
}

.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 24px 20px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.hero {
  display: block;
}

.hero-copy,
.panel {
  background: var(--paper);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 18px 24px;
  background:
    linear-gradient(135deg, rgba(106, 63, 179, 0.92), rgba(150, 111, 214, 0.84)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  color: white;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  position: relative;
}

.logout-form {
  position: absolute;
  top: 14px;
  right: 16px;
}

.hero-logout {
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.brand-row {
  margin: 0;
  grid-row: 1 / span 2;
  grid-column: 1;
  justify-self: start;
  position: relative;
  padding-right: 22px;
}

.brand-row::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.55) 20%,
    rgba(255, 255, 255, 0.55) 80%,
    rgba(255, 255, 255, 0)
  );
}

.brand-logo {
  display: block;
  width: 170px;
  max-width: 100%;
  height: auto;
}

.hero-copy h1,
.hero-copy .hero-text {
  grid-column: 2;
  text-align: left;
}

.eyebrow {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Georgia", serif;
}

h1 {
  font-size: clamp(2rem, 2.4vw, 2.8rem);
  line-height: 1.02;
}

.hero-text,
.panel-header p,
.helper-text,
.status-text,
.empty-state,
.result-message,
.error-state p,
.detail-list,
.field span {
  color: var(--muted);
}

.hero-text {
  max-width: 52rem;
  margin: 8px 0 0;
  font-size: 0.96rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.95fr);
  gap: 16px;
  min-height: 0;
}

.panel {
  padding: 18px 20px;
  min-height: 0;
  overflow: auto;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-header h2 {
  font-size: 1.35rem;
}

.panel-header p {
  margin: 6px 0 0;
  line-height: 1.4;
  font-size: 0.92rem;
}

.generator-form {
  display: grid;
  gap: 14px;
}

.dropzone {
  position: relative;
  min-height: 128px;
  padding: 18px;
  border: 1.5px dashed rgba(31, 111, 100, 0.35);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(229, 218, 246, 0.62), rgba(255, 241, 235, 0.9));
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.dropzone:hover,
.dropzone.drag-active {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 16px 28px rgba(31, 111, 100, 0.08);
}

.dropzone-copy {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 88px;
}

.dropzone-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
}

.dropzone-subtitle,
.dropzone-meta {
  margin: 8px 0 0;
}

.dropzone-meta {
  font-size: 0.88rem;
}

.file-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(30, 42, 40, 0.18);
  border-radius: 14px;
  background: var(--paper-strong);
  color: var(--ink);
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(31, 111, 100, 0.15);
  border-color: var(--primary);
}

.form-actions,
.download-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.primary-button {
  padding: 13px 20px;
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ghost-button {
  padding: 8px 12px;
  background: transparent;
  color: var(--primary-dark);
}

.results-panel {
  display: grid;
  align-content: start;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  border-radius: 24px;
  border: 1px dashed var(--line);
  background: rgba(255, 253, 248, 0.7);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.summary-card {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.95), rgba(240, 235, 250, 0.92));
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.details-sections {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.detail-box {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
}

.detail-box h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
}

.error-state {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(140, 47, 57, 0.16);
  background: var(--danger-soft);
  color: var(--danger);
}

.error-state h3 {
  font-size: 1.15rem;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.login-brand {
  padding: 18px 20px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(106, 63, 179, 0.92), rgba(150, 111, 214, 0.84)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
}

.login-logo {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
}

.login-copy h1 {
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-button {
  justify-self: start;
}

@media (max-width: 960px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  body {
    overflow: auto;
  }

  .page-shell {
    min-height: auto;
  }

  .hero-copy {
    grid-template-columns: 1fr;
  }

  .brand-row,
  .hero-copy .eyebrow,
  .hero-copy h1,
  .hero-copy .hero-text {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 14px 12px 24px;
  }

  .hero-copy,
  .panel {
    padding: 16px;
  }

  .field-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.2rem;
  }
}
