/* App Specific Styles */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 2rem;
  position: relative;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.u-file-menu {
  position: relative;
  display: none;
}

.u-file-menu.active,
.is-user .u-file-menu {
  display: block;
}

.u-file-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s;
  max-width: 280px;
  position: relative;
}

.u-file-trigger:hover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 20px;
  background: transparent;
}

.u-file-trigger:hover {
  background: var(--bg);
}

.u-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.reupload-icon {
  color: var(--gray);
  transition: color 0.2s;
  margin-left: 2px;
  cursor: pointer;
}

.reupload-icon:hover {
  color: var(--text);
}

.u-dropdown {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
}

.u-file-menu:hover .u-dropdown,
.u-file-trigger:hover+.u-dropdown,
.u-dropdown:hover {
  display: flex;
}

.u-drop-item {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border-bottom: 1px solid var(--ring);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.u-drop-item:last-child {
  border-bottom: none;
}

.u-drop-item:hover {
  background: var(--bg);
}

.u-drop-item.danger {
  color: var(--danger);
}

.is-guest .u-login {
  display: block;
}

.u-login {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  display: none;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.u-login:hover {
  background: var(--bg);
}

.onboarding {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1100px;
  width: 100%;
  transition: transform 0.8s ease, opacity 0.8s ease;
  margin-top: 20vh;
  overflow: visible;
}

.onboarding.top {
  transform: translateY(-30vh);
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  text-align: center;
}

p.sub {
  color: var(--gray);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 3rem;
}

/* CV Pill */
.cv-pill {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 40px;
  padding: 1.5rem 3rem;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all 0.4s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  width: 100%;
  justify-content: center;
  max-width: 400px;
}

.cv-pill:hover,
.cv-pill.dragover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transform: scale(1.02);
  border-color: var(--text);
}

.cv-pill input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.progress-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 40px;
  pointer-events: none;
  transition: border-color 0.3s;
}

/* Workspace Stage */
.workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
  pointer-events: none;
  position: absolute;
  top: 4rem;
}

.workspace.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  position: relative;
  top: 0;
}

.matches-heading {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gray);
  text-transform: uppercase;
  margin-bottom: 1rem;
  margin-top: 0;
}

/* Matches List */
.matches {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  margin-top: 1rem;
}

.match-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  overflow: visible;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.m-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  min-width: 250px;
}

.m-titles {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.m-role-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

a.m-role,
span.m-role {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

a.m-role:hover {
  text-decoration: underline;
  color: var(--text);
}

.link-icon {
  width: 14px;
  height: 14px;
  stroke: var(--gray);
  stroke-width: 2.5;
  fill: none;
  transition: stroke 0.2s;
}

a.m-role:hover .link-icon {
  stroke: var(--text);
}

.m-company {
  font-size: 0.9rem;
  color: var(--gray);
  font-weight: 400;
}

.m-score {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 38px;
}

.m-score-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 600;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  height: 100%;
}

.m-score-val {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 1.1rem;
  background: #fdfdfd;
  padding: 0 1rem;
  border-radius: 8px;
  border: 1px solid var(--ring);
  height: 100%;
}

.m-score-old {
  color: var(--gray);
  text-decoration: line-through;
  font-size: 0.85rem;
}

.m-score-arrow {
  color: var(--border);
  font-size: 0.8rem;
}

.m-score-new {
  color: var(--success);
  font-weight: 700;
}

.m-score-base {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--btn-text);
}

.m-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-action-wrap {
  position: relative;
  display: inline-block;
}

.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
}

.btn-action-wrap:hover .tooltip.visible {
  opacity: 1;
}

/* Loading Skeleton */
.loading-card {
  justify-content: flex-start;
  gap: 2rem;
  color: var(--gray);
  pointer-events: none;
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--ring);
  border-top-color: var(--text);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.m-progress-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.m-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.m-progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--text);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-text {
  color: var(--text);
  font-size: 0.9rem;
}

.error-text {
  color: var(--danger);
  font-size: 0.9rem;
  flex: 1;
}

/* Verification Warnings */
.m-warning {
  width: 100%;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #795548;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.m-warning-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #f57c00;
}

.m-warning-list {
  list-style: disc;
  margin-left: 1.25rem;
}

.m-warning-item {
  margin-bottom: 0.2rem;
}

.m-failed-match {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  height: 100%;
}

/* Circular Progress */
.u-cv-progress {
  width: 20px;
  height: 20px;
  position: relative;
  margin-right: 8px;
}

.u-cv-progress svg {
  transform: rotate(-90deg);
}

.u-cv-progress circle {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}

.u-cv-progress .bg {
  stroke: var(--border);
}

.u-cv-progress .fg {
  stroke: var(--text);
  stroke-dasharray: 50.24; /* 2 * PI * 8 */
  stroke-dashoffset: 50.24;
  transition: stroke-dashoffset 0.4s ease;
}

/* Input Area Container */
.input-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px dashed var(--border);
  text-align: center;
  transition: all 0.3s ease;
}

.job-input-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  width: 100%;
}

.header-with-credits {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.credits-badge {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.input-box {
  display: flex;
  width: 100%;
  max-width: 600px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}

.input-box input {
  flex: 1;
  border: none;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  outline: none;
  background: transparent;
  color: var(--text);
}

.input-box button {
  background: var(--text);
  color: var(--surface);
  border: none;
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.input-box button:hover { filter: brightness(1.2); }

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.input-box button .btn-spinner,
.btn-action.primary .btn-spinner,
.btn-modal.primary .btn-spinner {
  border-color: rgba(255,255,255,0.3);
  border-top-color: #fff;
}

@media (prefers-color-scheme: dark) {
  .input-box button .btn-spinner,
  .btn-action.primary .btn-spinner,
  .btn-modal.primary .btn-spinner {
    border-color: rgba(0,0,0,0.15);
    border-top-color: #000;
  }
}

.btn-text {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: underline;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-text:hover { opacity: 1; }

/* Payment Area */
.payment-area {
  display: none;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  width: 100%;
  padding: 1rem 0;
}

.payment-area.active {
  display: flex;
}

.pay-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pay-sub {
  color: var(--gray);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.btn-stripe {
  background: #635bff;
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.btn-stripe:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 91, 255, 0.4);
}

@media (prefers-color-scheme: dark) {
  .btn-stripe {
    background: #10d959;
    color: #000;
  }
  .btn-stripe:hover {
    box-shadow: 0 4px 14px rgba(16, 217, 89, 0.4);
  }
}

/* Modals */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 90vh;
}

.overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: left;
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  line-height: 1;
}

.btn-close:hover { color: var(--text); }

.modal.preview { max-width: 800px; }

.preview-body {
  background: var(--bg);
  border: 1px solid var(--ring);
  border-radius: 12px;
  padding: 2rem;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  height: 60vh;
  text-align: left;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.preview-body h4 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #111;
}

.preview-body p { margin-bottom: 0.75rem; }

.btn-modal {
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.btn-modal.primary {
  background: var(--text);
  color: var(--surface);
  border: 1px solid var(--text);
}

.btn-modal.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-modal:hover { filter: brightness(1.2); }

.modal-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
}

.modal-input:focus {
  border-color: var(--gray);
}

.manual-input {
  width: 100%;
  height: 200px;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  resize: none;
}



/* Landing Details Section */
.landing-text-area {
  margin-top: 4rem;
  padding: 4rem 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.explanation-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
}

.reality-col h3, .features-col h3 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.stats-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.stat-pill {
  background: var(--bg);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.reality-col p {
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.feature-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.f-icon {
  width: 40px;
  height: 40px;
  background: var(--bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.feature-row-content h4 {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.feature-row-content p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.4;
}

.cv-highlight {
  background: rgba(255, 235, 59, 0.18);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: inherit;
}

@media (prefers-color-scheme: dark) {
  .cv-highlight {
    background: rgba(255, 193, 7, 0.15);
  }
}

/* Drag & Drop Overlay */
.global-drop-zone {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  border: 4px dashed var(--text);
  margin: 1rem;
  border-radius: 20px;
  pointer-events: none;
}

.global-drop-zone.active {
  display: flex;
}

.drop-content {
  text-align: center;
  color: var(--text);
}

.drop-content p {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1rem;
}

/* Main input panel positioning inside workspace */
#mainInputPanel {
  margin-top: 5rem;
  margin-bottom: 5rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA Mini Box */
.cta-mini-box {
  margin-top: 2.5rem;
  margin-bottom: 4rem;
  background: var(--text);
  color: var(--surface);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: left;
}

.cta-mini-box h4 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.cta-mini-box p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  .cta-mini-box p {
    color: rgba(0, 0, 0, 0.6);
  }
}

.cta-mini-box button {
  background: var(--surface);
  color: var(--text);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Warning text in landing section */
.warning-text {
  color: var(--danger);
  font-weight: 600;
}
