﻿:root {
  color-scheme: light;
  --bg-night: #130f24;
  --bg-plum: #20162f;
  --bg-rose: #36213f;
  --aurora-cyan: rgba(100, 211, 255, 0.18);
  --aurora-gold: rgba(255, 214, 143, 0.18);
  --aurora-pink: rgba(255, 145, 196, 0.16);
  --panel: rgba(20, 16, 34, 0.58);
  --panel-strong: rgba(16, 12, 28, 0.78);
  --panel-soft: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 224, 176, 0.18);
  --line-strong: rgba(255, 224, 176, 0.34);
  --text: #f6f0ff;
  --muted: #c5bbd8;
  --accent: #ffd58e;
  --accent-strong: #ffb86b;
  --accent-soft: rgba(255, 213, 142, 0.12);
  --danger: #ff8f93;
  --success: #8fe0bb;
  --shadow-soft: 0 24px 60px rgba(4, 0, 16, 0.26);
  --shadow-strong: 0 40px 120px rgba(4, 0, 16, 0.42);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,0.12), transparent 0 22%),
    radial-gradient(circle at 85% 12%, var(--aurora-cyan), transparent 0 22%),
    radial-gradient(circle at 70% 32%, var(--aurora-pink), transparent 0 20%),
    radial-gradient(circle at 18% 75%, rgba(255, 209, 158, 0.10), transparent 0 18%),
    linear-gradient(145deg, var(--bg-night) 0%, var(--bg-plum) 45%, var(--bg-rose) 100%);
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.16) 0 1px, transparent 1px 100%),
    radial-gradient(circle at 70% 20%, rgba(255,255,255,0.14) 0 1px, transparent 1px 100%),
    radial-gradient(circle at 85% 65%, rgba(255,255,255,0.16) 0 1px, transparent 1px 100%),
    radial-gradient(circle at 42% 78%, rgba(255,255,255,0.10) 0 1px, transparent 1px 100%);
  background-size: 280px 280px, 340px 340px, 300px 300px, 380px 380px;
  opacity: 0.45;
}
body::after {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
}
body.auth-pending main,
body.auth-pending .action-bar-shell { visibility: hidden; }

a { color: inherit; }

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 164px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fadeRise .55s ease both;
}
.page-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}
.title-stack {
  display: grid;
  gap: 6px;
}
.page-kicker {
  margin: 0;
  color: rgba(255, 218, 178, 0.78);
  letter-spacing: 0.28em;
  font-size: 0.76rem;
  text-transform: uppercase;
}
.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.nav-link,
button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0 16px;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.nav-link:hover,
button:hover { transform: translateY(-1px); }
.nav-link,
.ghost-button {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #2d1d0b;
  font-weight: 700;
  box-shadow: 0 18px 36px rgba(255, 179, 104, 0.24);
}
button:disabled {
  opacity: .65;
  cursor: wait;
  transform: none;
}

.panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03)), var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeRise .65s ease both;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), transparent 35%, transparent 70%, rgba(255,214,143,0.08));
  pointer-events: none;
}
.panel > * { position: relative; z-index: 1; }

.section {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
.section:last-child { margin-bottom: 0; }
.field {
  display: grid;
  gap: 8px;
}
.field label {
  font-size: .95rem;
  font-weight: 700;
  color: #f5ecff;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(7, 6, 16, 0.36);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
input::placeholder,
textarea::placeholder {
  color: rgba(230, 221, 245, 0.44);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(255, 215, 159, 0.58);
  box-shadow: 0 0 0 4px rgba(255, 213, 142, 0.10), inset 0 1px 0 rgba(255,255,255,0.08);
}
textarea {
  min-height: 132px;
  resize: none;
  line-height: 1.65;
  overflow: hidden;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 220, 185, 0.86) 50%), linear-gradient(135deg, rgba(255, 220, 185, 0.86) 50%, transparent 50%);
  background-position: calc(100% - 22px) calc(50% - 3px), calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.two-column,
.date-row,
.search-row,
.action-buttons {
  display: grid;
  gap: 12px;
}
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.search-row { grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; }
.action-buttons { grid-template-columns: 1fr 1fr; }
.date-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.date-actions { display: grid; grid-template-columns: repeat(2, minmax(88px, 1fr)); gap: 12px; }
.date-actions button { width: 100%; }

.helper-text,
.status-text,
.section-title,
.empty-text { margin: 0; }
.helper-text,
.status-text,
.section-title,
.page-copy,
.empty-text { color: var(--muted); }
.status-text.error { color: var(--danger); }
.status-text.success { color: var(--success); }
.section-title {
  margin-bottom: 14px;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 218, 178, 0.76);
}

.card-select-list,
.mapping-preview {
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  line-height: 1.6;
}
.card-select-list {
  display: grid;
  gap: 12px;
}
.card-select-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.mapping-preview {
  white-space: pre-wrap;
  word-break: break-word;
  color: #f3ecff;
}

.result-list { display: grid; gap: 14px; }
.result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  background: rgba(255,255,255,0.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.result-text { display: grid; gap: 8px; }
.result-line { line-height: 1.7; }
.divider {
  color: rgba(255, 220, 190, 0.30);
  margin: 0 6px;
}
.result-actions { display: grid; grid-template-columns: repeat(2, auto); gap: 10px; }

.action-bar-shell {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 18px 18px;
  background: linear-gradient(180deg, rgba(19,15,36,0), rgba(19,15,36,.74) 22%, rgba(19,15,36,.94) 100%);
  z-index: 24;
}
.action-bar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  background: rgba(11, 9, 22, 0.80);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: grid;
  gap: 12px;
}
.action-status {
  text-align: center;
  min-height: 1.6em;
  font-size: .94rem;
}

.page-login {
  display: grid;
  place-items: center;
  padding: 28px 20px;
}
.page-login main {
  width: min(100%, 460px);
  padding: 0;
}
.auth-card { padding: 30px; }
.auth-card h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.8rem);
  letter-spacing: -0.05em;
}
.auth-card .page-copy {
  margin: 10px 0 22px;
  line-height: 1.7;
}

.preview-section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: rgba(255, 220, 180, 0.82);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .76rem;
}

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

@media (max-width: 760px) {
  main { padding: 18px 14px 160px; }
  .page-header {
    display: grid;
    justify-content: stretch;
    padding: 18px;
  }
  .nav-row {
    width: 100%;
    justify-content: flex-start;
  }
  .nav-link,
  button { min-height: 46px; }
  .search-row,
  .result-item,
  .result-actions,
  .two-column,
  .action-buttons { grid-template-columns: 1fr; }
  .date-row { grid-template-columns: 1fr; }
  .card-select-row { grid-template-columns: 1fr; }
}





.page-login { align-content: center; }
@media (max-width: 760px) {
  body.page-login { display: block !important; min-height: auto; padding: 16px 14px 28px; }
  body.page-login main { width: 100%; max-width: 460px; margin: 0 auto; padding: 0; }
}


@media (max-width: 760px) {
  body.page-login {
    display: block !important;
    min-height: auto;
    padding: 16px 14px 28px;
  }
  body.page-login main {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 0;
  }
}
