/* ============================================
   ATS-check — page-specific styles
   Identical design system as profilanalys-LIP
   ============================================ */

/* === Tool Hero - full-width gradient intro === */

/* Remove container top/bottom padding so hero gradient sits flush against nav */
.container {
  padding-top: 0;
  padding-bottom: 0;
}

.tool-hero {
  margin-bottom: var(--space-6);
}

.tool-hero-bg {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-signature);
  border-bottom: 1px solid rgba(0, 160, 155, 0.15);
}

.tool-hero-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4) var(--space-6);
}

.tool-hero-title {
  font-family: 'Lora', serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-3);
}

.tool-hero-tagline {
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--font-size-body);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-2);
}

.tool-hero-tagline:last-child {
  margin-bottom: 0;
}

/* === Sub-row: "Visa tidigare" (4/6) + "Verktygsinstruktioner" (2/6) === */

.tool-hero-sub {
  display: grid;
  grid-template-columns: 4fr 2fr;
  align-items: start;
  margin-top: var(--space-4);
}

.tool-hero-sub .tool-history {
  grid-column: 1;
  margin-top: 0;
}

.tool-hero-sub .tool-instructions-link {
  grid-column: 2;
  justify-self: end;
  align-self: center;
  margin-bottom: 0;
}

.tool-hero-sub .tool-history-panel {
  grid-column: 1 / -1;
}

/* History widget below hero */
.tool-hero .tool-history-toggle {
  color: var(--color-text-secondary);
}

.tool-hero .tool-history-count {
  background: var(--color-bg-input);
}

@media (max-width: 600px) {
  .tool-hero-inner {
    padding: var(--space-6) var(--space-3) var(--space-4);
  }
  .tool-hero-title {
    font-size: 1.3rem;
  }
}

/* ============================================
   Tool Instructions Link
   ============================================ */

.tool-instructions-link {
  display: flex;
  justify-content: flex-start;
  margin-bottom: var(--space-3);
}

.tool-instructions-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: var(--space-1) 0;
  cursor: pointer;
  font-family: var(--font-family);
  transition: color 0.15s;
  color: var(--color-text-muted);
}

.tool-instructions-btn:hover {
  color: var(--color-secondary-teal);
}

.tool-instructions-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #00a09b;
  background: #00a09b;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.tool-instructions-text {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
}

/* ============================================
   LIP Typography & Spacing Overrides
   ============================================ */

p {
  font-size: var(--font-size-small);
  line-height: var(--line-height-relaxed);
  color: rgba(0, 0, 0, 0.7);
}

/* Reset color for hero (white text) */
.tool-hero p,
.tool-hero-bg p {
  color: rgba(255, 255, 255, 0.92);
}

/* Reset color for overlay */
.intro-overlay p {
  color: var(--color-text-primary);
}

h2 {
  font-family: 'Lora', serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.tool-hero-inner h2 {
  font-family: 'Lora', serif;
  font-size: 28px;
  font-weight: 700;
}

.section-body {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.7);
}

.evidence {
  color: rgba(0, 0, 0, 0.7);
}

.citerad-wrap.has-citat strong {
  font-size: 16px;
}

/* --- Consistent inner spacing --- */

.input-section {
  margin-bottom: var(--space-4);
}

.input-help {
  margin-bottom: var(--space-2);
}

.input-actions {
  margin-top: var(--space-3);
}

.loading-section {
  padding: var(--space-4) 0;
}

/* ============================================
   ATS-check result-specific styles
   ============================================ */

/* Tag variants */
.tag-green {
  background: rgba(0, 160, 155, 0.1);
  color: var(--color-secondary-teal);
  border-color: rgba(0, 160, 155, 0.2);
}

.tag-muted {
  background: var(--color-bg-page);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

/* Section intro text */
.section-intro {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.7);
}

/* Signal / citerad wrap spacing */
.signal .citerad-wrap,
.fact-list .citerad-wrap {
  margin-top: 10px;
  margin-bottom: 10px;
}

/* ============================================
   CV list styles (matching profilanalys-LIP)
   ============================================ */

.v2-cv-list {
  background: #f5f5f0;
  border: 1.5px dashed #d4d0c8;
}

.v2-cv-item {
  background: #fffffb;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.v2-cv-item:hover {
  background: #eeedea;
}

.v2-cv-item.selected {
  background: #dbffe057;
}

.v2-cv-item.selected .v2-cv-item-radio {
  border-color: #00a09b;
  background: #00a09b;
}

/* Load more buttons (CV list + history) */
.v2-cv-load-more,
.tool-history-load-more {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  background: #fffffb;
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary-teal);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.v2-cv-load-more:hover,
.tool-history-load-more:hover {
  background: rgba(0, 160, 155, 0.04);
  color: #008A85;
}

/* --- History list (Visa tidigare) --- */

.tool-history-panel {
  background: #f5f5f0;
  border: 1.5px dashed #d4d0c8;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.tool-history-item {
  background: #fffffb;
}

.tool-history-item:hover {
  background: #eeedea;
}

/* ============================================
   Button overrides: #458f85 palette
   ============================================ */

/* Analysera / Kör (btn-primary) */
.btn-primary {
  background: #458f85;
  border: none;
}

.btn-primary:hover {
  background: #3a7a71;
  border: none;
  opacity: 1;
  box-shadow: 0px 2px 8px 0px rgba(69, 143, 133, 0.35);
}

/* Ny analys (btn-secondary) */
.btn-secondary {
  color: #458f85;
  border-color: #458f85;
}

.btn-secondary:hover {
  background: #458f85;
  border-color: #458f85;
  color: #fff;
}

/* Ladda upp: hover */
.v2-file-btn:hover {
  border-color: #458f85;
  color: #458f85;
  background: rgba(69, 143, 133, 0.04);
}

/* Radio-btn hover */
.v2-cv-item:hover .v2-cv-item-radio {
  border-color: #458f85;
}

/* ============================================
   Header accent: dashed border instead of gradient
   ============================================ */

.app-header-accent {
  height: 0;
  background: none;
  border-bottom: 1.5px dashed #d4d0c8;
}

/* ============================================
   Plan zone → footer: remove gap
   ============================================ */

.plan-zone {
  margin-top: 0;
  margin-bottom: 0;
}

.plan-zone-bg {
  margin-bottom: 0;
}

/* ============================================
   Nästa steg: full-width background
   ============================================ */

.nasta-steg-section {
  margin-top: var(--space-8);
  margin-bottom: 0;
  background: #fbfbfb;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

/* ============================================
   Footer: flush against last section
   ============================================ */

.lip-footer {
  margin-top: 0;
  background: #fbfbfb;
  border-top: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-6);
}

.lip-footer .lip-footer-copyright {
  font-size: 14px;
  color: var(--color-text-muted);
  order: 1;
}

.lip-footer .lip-footer-disclaimer {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  max-width: none;
  order: 2;
}

/* ============================================
   Reset section
   ============================================ */

.reset-section {
  text-align: center;
  margin-top: var(--space-5);
  margin-bottom: var(--space-4);
}

/* ============================================
   Intro overlay
   ============================================ */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: overlayFadeIn 0.3s ease;
}

.intro-overlay.hidden {
  display: none;
}

.intro-overlay.closing {
  animation: overlayFadeOut 0.35s ease forwards;
}

.intro-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.intro-overlay-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-bg-card);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  animation: panelSlideUp 0.35s ease;
}

.intro-overlay.closing .intro-overlay-panel {
  animation: panelSlideDown 0.3s ease forwards;
}

.intro-overlay-header {
  text-align: center;
  padding: var(--space-6) var(--space-5) var(--space-4);
  border-bottom: var(--border-subtle);
}

.intro-overlay-title {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-heading);
  margin-bottom: var(--space-1);
}

.intro-overlay-tagline {
  color: var(--color-text-secondary);
  font-size: var(--font-size-body);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-2);
}

.intro-overlay-body {
  padding: var(--space-5);
  font-size: var(--font-size-body);
  color: var(--color-text-primary);
  line-height: var(--line-height-relaxed);
}

.intro-overlay-body p {
  margin-bottom: var(--space-3);
}

.intro-overlay-body p:last-of-type {
  margin-bottom: 0;
}

.intro-overlay-cta {
  padding: var(--space-4) var(--space-5) var(--space-6);
  text-align: center;
}

.intro-overlay-cta .btn-primary {
  padding: 10px 15px;
  font-size: var(--font-size-body);
}

/* === Info examples (overlay content) === */

.info-examples {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-card);
}

.info-examples-label {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-3);
}

.info-example-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.info-example-list li {
  font-size: var(--font-size-body);
  color: var(--color-text-primary);
  padding-left: var(--space-4);
  position: relative;
  line-height: var(--line-height-relaxed);
}

.info-example-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-secondary-teal);
  font-weight: var(--font-weight-bold);
  line-height: 1.75;
}

/* === Service link (in overlay) === */

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-family);
}

.service-link:hover {
  color: var(--color-secondary-teal);
}

.service-link-external {
  font-size: 11px;
  opacity: 0.5;
}

/* === Overlay animations === */

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes overlayFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes panelSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 640px) {
  .intro-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .intro-overlay-panel {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
  }
}

/* ============================================
   BTN overrides (size/padding)
   ============================================ */

.btn {
  font-size: 14px;
  padding: 10px 15px;
  text-transform: none;
}

.v2-file-btn {
  padding: 10px 15px;
}

.intro-overlay-cta .btn-primary {
  font-size: 14px;
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
}

/* ============================================
   Hide char-count row (kept for JS compatibility)
   ============================================ */

.input-actions {
  display: none !important;
}

/* ============================================
   Analyze button inline with secondary actions
   ============================================ */

#atsAnalyzeBtn {
  margin-left: auto;
}

/* ============================================
   Step-collapse overrides for ATS
   ============================================ */

/* Remove default input-section margin inside step body */
.step-collapse-body .input-section {
  margin-bottom: 0;
}

/* Step-collapse header inside step body */
.step-collapse-body h3 {
  font-family: var(--font-family);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

.step-collapse-body h3:first-child {
  margin-top: 0;
}

/* Reset section: hide standalone, keep inline */
.reset-section {
  display: none;
}

/* Step continue row (inside last step) */
.step-continue {
  display: flex;
  justify-content: flex-start;
  padding-top: var(--space-4);
  margin-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* ============================================
   Loader color override
   ============================================ */

.loader {
  border-color: rgba(69, 143, 133, 0.15);
  border-top-color: #458f85;
}

/* ============================================
   Textarea border override
   ============================================ */

.v2-textarea {
  border-color: var(--color-border);
}

.v2-textarea:hover {
  border-color: rgba(69, 143, 133, 0.4);
  background: rgba(69, 143, 133, 0.02);
}

.v2-textarea:focus {
  border-color: #458f85;
  background: rgba(69, 143, 133, 0.03);
  box-shadow: 0 0 0 3px rgba(69, 143, 133, 0.08);
}

/* ============================================
   Dropzone hover override (teal instead of pink)
   ============================================ */

.v2-dropzone:hover,
.v2-dropzone.drag-over {
  border-color: rgba(69, 143, 133, 0.4);
  background: rgba(69, 143, 133, 0.03);
}

/* "välj fil" link color override */
.v2-dropzone-text strong {
  color: inherit;
  font-weight: inherit;
}

/* ============================================
   Sticky-to-bottom layout
   ============================================ */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.landing-tools-shortcut {
  margin-top: auto;
  padding: var(--space-6) var(--space-4);
}

.landing-tools-inner {
  max-width: 760px;
  margin: 0 auto;
}

/* Landing tools label color */
.landing-tools-label {
  color: var(--color-text-secondary);
}
