:root {
  color-scheme: dark;
  --bg: #07070a;
  --surface: rgba(18, 18, 24, 0.82);
  --surface-2: rgba(255, 255, 255, 0.055);
  --surface-3: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f8fafc;
  --muted: #a1a1aa;
  --subtle: #71717a;
  --accent: #ef4444;
  --accent-2: #f97316;
  --accent-ink: #ffffff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --focus-soft: rgba(249, 115, 22, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(239, 68, 68, 0.18), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.13), transparent 34rem),
    linear-gradient(135deg, #050507 0%, #09090d 50%, #101014 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(239, 68, 68, 0.24);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(239, 68, 68, 0.34);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
  color: var(--subtle);
  box-shadow: none;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}

.ghost-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.075);
  border-color: var(--line-strong);
  box-shadow: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
}

.is-hidden {
  display: none !important;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 900;
}

h2 {
  font-size: 1.12rem;
  letter-spacing: -0.03em;
  font-weight: 850;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-shell {
  min-height: calc(100vh - 56px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
}

.brand-lockup {
  width: min(450px, 100%);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 1.55rem;
  font-weight: 950;
  box-shadow: 0 18px 42px rgba(239, 68, 68, 0.32);
}

.login-form {
  width: min(450px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.052);
  color: var(--text);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input[type="email"]:focus,
input[type="password"]:focus {
  border-color: rgba(249, 115, 22, 0.76);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 4px var(--focus-soft);
}

.workspace {
  display: grid;
  gap: 18px;
}

.workspace-header,
.upload-panel,
.file-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.032)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
}

.workspace-header {
  min-height: 142px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(20px, 3vw, 32px);
  position: relative;
  overflow: hidden;
}

.workspace-header::after {
  content: "";
  position: absolute;
  right: -110px;
  top: -120px;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.18), transparent 70%);
  pointer-events: none;
}

.upload-panel {
  padding: clamp(18px, 2.4vw, 28px);
  display: grid;
  gap: 14px;
}

.dropzone {
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  border: 1.5px dashed rgba(255, 255, 255, 0.17);
  border-radius: 22px;
  background:
    radial-gradient(circle at center, rgba(239, 68, 68, 0.09), transparent 34rem),
    rgba(255, 255, 255, 0.035);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: rgba(249, 115, 22, 0.8);
  background:
    radial-gradient(circle at center, rgba(239, 68, 68, 0.14), transparent 34rem),
    rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  text-align: left;
  pointer-events: none;
}

.upload-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f5f5f5;
}

.upload-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transform: translateY(1px);
}

.dropzone strong,
.dropzone span {
  display: block;
}

.dropzone strong {
  font-size: 1.18rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.dropzone span {
  margin-top: 5px;
  color: var(--muted);
}

.selected-row,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.selected-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

#selected-count {
  color: var(--muted);
  font-weight: 650;
}

.status {
  min-height: 24px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.status.success {
  color: var(--ok);
}

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

.file-section {
  padding: clamp(18px, 2.4vw, 28px);
}

.file-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.file-item,
.empty-state {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.file-name {
  overflow-wrap: anywhere;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.file-meta {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: 0.88rem;
  font-weight: 650;
}

.empty-state {
  justify-content: center;
  color: var(--muted);
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 22px, 1120px);
    padding: 16px 0;
  }

  .auth-shell {
    min-height: calc(100vh - 32px);
  }

  .brand-lockup,
  .workspace-header,
  .selected-row,
  .section-header,
  .file-item {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: center;
    text-align: center;
  }

  .workspace-header {
    min-height: auto;
  }

  .dropzone {
    min-height: 180px;
  }

  .dropzone-body {
    flex-direction: column;
    text-align: center;
  }

  button {
    width: 100%;
  }

  .file-meta {
    flex: 1 1 auto;
  }
}
