:root {
  --ink: #102236;
  --ink-soft: #425e7d;
  --surface: #ffffff;
  --surface-soft: #f6fbff;
  --surface-muted: #eef4fa;
  --border: #ccdae8;
  --border-strong: #b5c8db;
  --accent: #007790;
  --accent-strong: #005b6f;
  --accent-soft: #d8f3fa;
  --good: #166534;
  --good-bg: #dcfce7;
  --danger: #8d1638;
  --danger-bg: #ffe3eb;
  --glow-a: #b6ecff;
  --glow-b: #ffd9b5;
  --shadow-soft: 0 18px 40px rgba(16, 34, 54, 0.09);
  --shadow-card: 0 10px 22px rgba(16, 34, 54, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  background:
    linear-gradient(130deg, #eff8ff 0%, #f5f8ff 48%, #fff4ea 100%),
    radial-gradient(circle at 12% 10%, #d6ecff 0%, transparent 36%),
    radial-gradient(circle at 85% 8%, #ffe6cb 0%, transparent 30%);
}

a {
  color: var(--accent-strong);
}

h1,
h2,
h3,
h4,
p,
label {
  margin: 0;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0.72rem 0.86rem;
  min-height: 2.9rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 7.5rem;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 119, 144, 0.2);
}

button {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 2.8rem;
  padding: 0.55rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease, background-color 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px rgba(16, 34, 54, 0.12);
}

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

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

.bg-orb {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 999px;
  filter: blur(44px);
  opacity: 0.62;
}

.orb-a {
  width: min(56vw, 36rem);
  aspect-ratio: 1;
  left: -10rem;
  top: -7rem;
  background: radial-gradient(circle at 35% 35%, var(--glow-a) 0%, transparent 70%);
}

.orb-b {
  width: min(54vw, 34rem);
  aspect-ratio: 1;
  right: -10rem;
  top: 10rem;
  background: radial-gradient(circle at 60% 35%, var(--glow-b) 0%, transparent 70%);
}

.page {
  width: min(1160px, calc(100vw - 1rem));
  margin: 0.7rem auto 2rem;
  display: grid;
  gap: 0.85rem;
}

.hero,
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.86) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 1rem;
  backdrop-filter: blur(6px);
}

.hero {
  display: grid;
  gap: 0.8rem;
  overflow: clip;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -55% auto;
  width: 17rem;
  height: 17rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(179, 236, 255, 0.5) 0%, transparent 74%);
  pointer-events: none;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.eyebrow,
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.66rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #084a58;
  background: var(--accent-soft);
  border: 1px solid #9dddea;
}

.hero h1,
h2,
h3 {
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.01em;
}

.hero h1 {
  font-size: clamp(1.65rem, 6vw, 2.95rem);
  line-height: 1.06;
  max-width: 19ch;
}

.subhead {
  color: var(--ink-soft);
  line-height: 1.58;
  max-width: 65ch;
}

.hero-highlights {
  list-style: none;
  margin: 0.1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hero-highlights li {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #194768;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.34rem 0.66rem;
}

.section-title {
  display: grid;
  gap: 0.28rem;
  margin-bottom: 0.9rem;
}

.section-title p {
  color: var(--ink-soft);
  line-height: 1.52;
}

.section-title.compact {
  margin-bottom: 0.55rem;
}

label {
  display: inline-block;
  margin-bottom: 0.36rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #173651;
}

.auth-form {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(245, 251, 255, 0.88) 0%, rgba(240, 247, 252, 0.72) 100%);
  padding: 0.92rem;
}

.auth-input-row {
  display: grid;
  gap: 0.5rem;
}

.auth-note {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.52;
}

.auth-status,
.status-pill {
  margin-top: 0.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  border: 1px solid #b7e8cb;
  background: #edfff4;
  color: var(--good);
  border-radius: 999px;
  padding: 0.35rem 0.66rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-status.is-error,
.status-pill.is-error {
  border-color: #f4becd;
  background: #fff1f6;
  color: var(--danger);
}

.app-shell {
  display: grid;
  gap: 0.85rem;
}

.workspace {
  display: grid;
  gap: 0.85rem;
}

.workspace-main {
  display: grid;
  gap: 0.85rem;
}

.history-sidebar {
  display: grid;
  gap: 0.62rem;
  align-content: start;
}

.onboarding-card {
  display: grid;
  gap: 0.7rem;
}

.onboarding-card.is-ready {
  border-color: #98d6c0;
  box-shadow: 0 0 0 2px rgba(56, 161, 105, 0.1), var(--shadow-soft);
}

.base-cv-form {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(246, 252, 255, 0.92) 0%, rgba(242, 249, 254, 0.78) 100%);
  padding: 0.85rem;
}

.base-cv-form textarea {
  min-height: 7rem;
}

.start-new-btn {
  width: 100%;
}

.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.session-copy {
  display: grid;
  gap: 0.18rem;
}

.session-email {
  font-size: 0.97rem;
  font-weight: 700;
  color: #143556;
  word-break: break-word;
}

.mobile-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.45rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  position: sticky;
  top: 0.4rem;
  z-index: 9;
}

.view-tab {
  border-radius: 999px;
  border-color: var(--border);
  background: transparent;
  color: #355671;
  min-height: 2.55rem;
}

.view-tab.is-active {
  border-color: #71cadb;
  background: linear-gradient(180deg, #0e8aa5 0%, #016c84 100%);
  color: #ffffff;
}

.view-section {
  display: none;
  gap: 0.85rem;
}

.view-section.is-active {
  display: grid;
}

.generator-layout {
  display: grid;
  gap: 0.85rem;
}

.stack-col {
  display: grid;
  gap: 0.8rem;
}

.panel {
  display: grid;
  gap: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.82rem;
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.92) 0%, rgba(243, 249, 255, 0.74) 100%);
  box-shadow: var(--shadow-card);
}

.panel h3 {
  font-size: 1.02rem;
}

.action-panel {
  align-content: start;
  gap: 0.62rem;
}

.action-panel p {
  color: var(--ink-soft);
  line-height: 1.5;
}

.structured-summary {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  padding: 0.7rem;
  font-size: 0.86rem;
  line-height: 1.52;
}

.structured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #1c496d;
  border-radius: 999px;
  padding: 0.3rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.meta-pill.link-pill {
  border-color: #9ecde5;
  color: #0a5a82;
}

.meta-pill.warning {
  border-color: #f2d8ae;
  background: #fff8ea;
  color: #8f6421;
}

.job-meta-grid,
.input-grid,
.results {
  display: grid;
  gap: 0.78rem;
}

.job-meta-grid article,
.input-grid article {
  display: grid;
  gap: 0.34rem;
}

.saved-job-row {
  display: grid;
  gap: 0.38rem;
}

.saved-job-controls {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.saved-job-controls .small {
  min-height: 2.6rem;
  padding-inline: 0.85rem;
}

.input-grid article {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  padding: 0.8rem;
}

.steps {
  margin: 0.15rem 0 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  display: grid;
  gap: 0.38rem;
  line-height: 1.5;
}

.results {
  margin-top: 0.12rem;
}

.doc-panel {
  display: grid;
  gap: 0.65rem;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.62rem;
  flex-wrap: wrap;
}

.doc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.doc-buttons button,
#refreshJobsBtn,
.job-actions button {
  min-height: 2.2rem;
  border-color: var(--border-strong);
  border-radius: 999px;
  padding: 0.4rem 0.74rem;
  background: #ffffff;
  color: #1a3f61;
  font-size: 0.84rem;
  font-weight: 700;
}

iframe {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.job-form {
  display: grid;
  gap: 0.68rem;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  cursor: pointer;
  font-weight: 600;
}

.checkbox-row span {
  color: #204766;
}

.checkbox-row input {
  width: 1.08rem;
  height: 1.08rem;
  min-height: 1.08rem;
  margin: 0;
  border-radius: 5px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.62rem;
}

.list-header.compact {
  margin-bottom: 0.42rem;
}

.list-header.compact h3 {
  font-size: 0.92rem;
}

.empty-state {
  color: var(--ink-soft);
}

.jobs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.job-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
  padding: 0.74rem;
  display: grid;
  gap: 0.5rem;
  box-shadow: var(--shadow-card);
}

.job-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.job-item-head strong {
  line-height: 1.34;
}

.sidebar-job {
  padding: 0.66rem;
}

.sidebar-job.is-selected {
  border-color: #7dcddd;
  box-shadow: 0 0 0 2px rgba(7, 139, 164, 0.14), var(--shadow-card);
}

.applications-list .job-description {
  font-size: 0.81rem;
  line-height: 1.42;
}

.applications-list .job-actions button {
  min-height: 2rem;
  font-size: 0.76rem;
  padding: 0.34rem 0.62rem;
}

.job-badge {
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.57rem;
  white-space: nowrap;
}

.badge-saved {
  background: #dcefff;
  color: #0d4b77;
}

.badge-applied {
  background: var(--good-bg);
  color: var(--good);
}

.job-description {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.job-meta a {
  font-weight: 700;
  color: var(--accent-strong);
  text-decoration: none;
}

.job-meta a:hover {
  text-decoration: underline;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.job-actions button.danger {
  border-color: #efbfd0;
  color: var(--danger);
  background: var(--danger-bg);
}

.btn-primary {
  color: #ffffff;
  border-color: #0d7087;
  background: linear-gradient(180deg, #0d8ca7 0%, #006f88 100%);
}

.btn-secondary {
  color: #ffffff;
  border-color: #0c6f82;
  background: linear-gradient(180deg, #1488a0 0%, #066f84 100%);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: #ffffff;
  color: #244a69;
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: rise-in 360ms ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 45ms;
}

.reveal:nth-child(3) {
  animation-delay: 85ms;
}

.reveal:nth-child(4) {
  animation-delay: 115ms;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 680px) {
  .page {
    width: min(1160px, calc(100vw - 1.5rem));
    margin-top: 1rem;
  }

  .hero,
  .card {
    padding: 1.15rem;
  }

  .hero-highlights li {
    font-size: 0.79rem;
  }

  .auth-input-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .auth-input-row .btn-primary {
    min-width: 12rem;
  }

  .job-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .job-meta-grid .full-width {
    grid-column: 1 / -1;
  }

  .results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  iframe {
    min-height: 430px;
  }
}

@media (min-width: 960px) {
  .page {
    width: min(1160px, calc(100vw - 2.2rem));
    margin-top: 1.3rem;
    gap: 1rem;
  }

  .hero,
  .card {
    padding: 1.2rem;
  }

  .workspace {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    align-items: start;
  }

  .history-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }

  .generator-layout {
    grid-template-columns: minmax(0, 1.34fr) minmax(270px, 0.66fr);
    align-items: start;
  }

  .action-panel {
    position: sticky;
    top: 1rem;
  }

  .input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  iframe {
    min-height: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
