:root {
  --bg-0: #e9f0fb;
  --bg-1: #dfe9f8;
  --ink: #0f172a;
  --ink-soft: #334155;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(15, 23, 42, 0.12);
  --brand: #1d4ed8;
  --brand-strong: #1e3a8a;
  --accent: #0891b2;
  --warm: #f97316;
  --ok-bg: #06111f;
  --ok-ink: #d9f4ff;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-lg: 0 32px 72px rgba(15, 23, 42, 0.16);
  --shadow-md: 0 18px 38px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 28px 16px 40px;
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(8, 145, 178, 0.2), transparent 38%),
    radial-gradient(circle at 90% 12%, rgba(29, 78, 216, 0.2), transparent 34%),
    linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 50%, #edf3ff 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 55% 32%, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.2) 70%, transparent 100%);
  opacity: 0.7;
}

.shape {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.7;
  animation: drift 14s ease-in-out infinite alternate;
}

.shape-a {
  width: 320px;
  height: 320px;
  left: -110px;
  top: -110px;
  background: rgba(8, 145, 178, 0.35);
}

.shape-b {
  width: 300px;
  height: 300px;
  right: -110px;
  bottom: -110px;
  background: rgba(29, 78, 216, 0.34);
  animation-delay: 2.8s;
}

.layout {
  position: relative;
  margin: 0 auto;
  width: min(1180px, 100%);
  display: grid;
  gap: 18px;
}

.layout > * {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 520ms ease forwards;
}

.layout > *:nth-child(2) {
  animation-delay: 80ms;
}

.layout > *:nth-child(3) {
  animation-delay: 140ms;
}

.hero {
  border-radius: var(--radius-xl);
  padding: clamp(18px, 2.4vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #eaf2ff;
  background:
    linear-gradient(118deg, rgba(15, 23, 42, 0.94), rgba(30, 58, 138, 0.9) 44%, rgba(8, 145, 178, 0.86));
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  right: -130px;
  top: -130px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0));
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.86;
}

h1,
h2 {
  margin: 0;
  font-family: 'Sora', sans-serif;
}

h1 {
  margin-top: 10px;
  font-size: clamp(30px, 5.2vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 14px 0 0;
  max-width: 70ch;
  line-height: 1.62;
  color: rgba(234, 242, 255, 0.9);
}

.subtitle code {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.14);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92em;
}

.hero-actions {
  margin-top: 18px;
}

#appContent {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: clamp(16px, 2vw, 22px);
  box-shadow: var(--shadow-md);
}

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

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.field > span {
  color: var(--ink-soft);
}

.format-hint {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

input[type='file'],
input[type='text'],
input[type='password'],
select,
button {
  font: inherit;
  border-radius: var(--radius-md);
}

input[type='file'],
input[type='text'],
input[type='password'],
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  padding: 11px 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input[type='file']:hover,
input[type='text']:hover,
input[type='password']:hover,
select:hover {
  border-color: rgba(30, 58, 138, 0.25);
}

input[type='file']:focus,
input[type='text']:focus,
input[type='password']:focus,
select:focus {
  outline: none;
  border-color: rgba(29, 78, 216, 0.65);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

button {
  cursor: pointer;
  border: none;
  padding: 11px 14px;
  font-weight: 700;
  color: #f8fbff;
  background: linear-gradient(118deg, var(--brand-strong), var(--brand) 46%, var(--accent));
  box-shadow: 0 14px 28px rgba(30, 58, 138, 0.26);
  transition: transform 170ms ease, box-shadow 170ms ease, filter 170ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 18px 34px rgba(30, 58, 138, 0.34);
}

button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.ghost-btn {
  border: 1px solid rgba(15, 23, 42, 0.16);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.09);
}

.ghost-btn:hover {
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.13);
}

.google-auth {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.google-signin {
  min-height: 42px;
}

.status {
  margin: 12px 0 0;
  min-height: 180px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(96, 165, 250, 0.24);
  background: radial-gradient(circle at 0% 0%, rgba(14, 165, 233, 0.08), transparent 36%), var(--ok-bg);
  color: var(--ok-ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.downloads.empty {
  color: #475569;
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--panel-strong);
}

.download-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(118deg, #0f766e, #0891b2);
}

.download-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(24px, -18px, 0) scale(1.08);
  }
}

@media (min-width: 980px) {
  #appContent {
    grid-template-columns: minmax(420px, 1.18fr) minmax(320px, 1fr);
  }

  #appContent > section:nth-child(1) {
    grid-column: 1;
  }

  #appContent > section:nth-child(2) {
    grid-column: 2;
  }

  #appContent > section:nth-child(3) {
    grid-column: 1 / span 2;
  }
}

@media (max-width: 760px) {
  body {
    padding: 16px 10px 24px;
  }

  .hero,
  .panel {
    padding: 14px;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

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