/**
 * Seevee Candidate Interface Styles
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #8b5cf6;
  --success: #10b981;
  --error: #ef4444;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Job Logo Section (inside job-info card) */
.job-logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

.job-logo-svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.job-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 20px;
}

.job-logo-icon.has-image {
  background: transparent;
}

.job-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.job-logo-svg.hidden,
.job-logo-icon.hidden {
  display: none;
}

/* Main Content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Loading State */
.loading-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error State */
.error-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.error-icon {
  width: 60px;
  height: 60px;
  background: #fef2f2;
  color: var(--error);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
}

.error-state h2 {
  margin-bottom: 10px;
}

.error-state p {
  color: var(--text-secondary);
}

/* Job Info */
.job-info {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
}

.company-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.job-info h1 {
  font-size: 28px;
  margin-bottom: 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.job-description {
  text-align: left;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 30px;
  font-size: 14px;
}

.stage2-welcome {
  text-align: center;
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  padding: 10px 0;
}

/* Job description expandable */
.job-desc-wrapper {
  line-height: 1.6;
}

.job-desc-preview p {
  color: var(--text-secondary);
  margin: 0;
  display: inline;
}

.job-desc-toggle {
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  margin-left: 4px;
}

.job-desc-toggle:hover {
  text-decoration: underline;
}

.job-desc-full.hidden,
.job-desc-preview.hidden {
  display: none;
}

/* Job description full view - markdown */
.job-desc-full {
  color: var(--text);
}

.job-desc-full .job-main-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.75rem 0;
}

.job-desc-full .job-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.25rem 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.375rem;
}

.job-desc-full .job-section-title:first-child {
  margin-top: 0;
}

.job-desc-full .job-paragraph {
  margin: 0.5rem 0;
  color: var(--text-secondary);
}

.job-desc-full .job-list {
  margin: 0.5rem 0 0.75rem 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.job-desc-full .job-list li {
  margin: 0.35rem 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.job-desc-full .job-list li strong {
  color: var(--text);
}

.job-desc-full > .job-desc-toggle {
  display: inline-block;
  margin-top: 1rem;
}

/* Structured Job Display */
.job-structured {
  line-height: 1.6;
}

.job-structured .job-summary {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.job-structured .job-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}

.job-structured .job-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.job-structured .job-badge svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.job-structured .job-badge span {
  line-height: 1;
}

.job-structured .job-section {
  margin-bottom: 1rem;
}

.job-structured .job-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.job-structured .job-section ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.job-structured .job-section li {
  margin: 0.35rem 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.job-structured .job-section p {
  color: var(--text-secondary);
  margin: 0;
}

/* Language Selection */
.language-selection {
  margin: 20px 0 30px;
  text-align: center;
}

.language-label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.language-select {
  padding: 12px 20px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  min-width: 200px;
  transition: border-color 0.2s;
}

.language-select:hover {
  border-color: var(--primary);
}

.language-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-large {
  padding: 16px 40px;
  font-size: 18px;
}

/* CV Step */
.cv-step {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.cv-step h2 {
  text-align: center;
  margin-bottom: 10px;
}

.step-description {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.cv-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.cv-upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.cv-upload-box:hover,
.cv-upload-box.dragover {
  border-color: var(--primary);
  background: #f5f3ff;
}

.upload-icon {
  color: var(--primary);
  margin-bottom: 16px;
}

.cv-upload-box p {
  margin-bottom: 8px;
}

.cv-upload-box .link {
  color: var(--primary);
  text-decoration: underline;
}

.file-types {
  font-size: 12px;
  color: var(--text-secondary);
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.cv-paste-box textarea {
  width: 100%;
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  resize: vertical;
  transition: border-color 0.2s;
}

.cv-paste-box textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* CV upload/paste analysing overlay */
.cv-upload-box,
.cv-paste-box {
  position: relative;
}

.cv-analyse-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
}

.cv-analyse-overlay .loader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.cv-analyse-overlay span {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* CV Preview */
.cv-preview {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 12px;
}

.preview-icon {
  width: 24px;
  height: 24px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.extracted-info {
  font-size: 14px;
}

.info-item {
  margin-bottom: 6px;
}

.info-item strong {
  color: var(--text);
}

.cv-step .btn {
  width: 100%;
}

/* Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 0; /* Allow flex shrinking */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px); /* Dynamic viewport for mobile */
  margin-top: auto;
  margin-bottom: auto;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.chat-avatar.has-image {
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.chat-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-info {
  flex: 1;
}

.chat-name {
  display: block;
  font-weight: 600;
}

.chat-status {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.progress-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s;
}

.progress-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Interview Timer */
.interview-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-left: auto;
}

.interview-timer svg {
  color: var(--primary);
}

.interview-timer.warning {
  background: #fef3c7;
  color: #92400e;
}

.interview-timer.warning svg {
  color: #f59e0b;
}

.interview-timer.danger {
  background: #fee2e2;
  color: #991b1b;
  animation: pulse 1s infinite;
}

.interview-timer.danger svg {
  color: #ef4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.interview-timer.hidden {
  display: none;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.message-assistant {
  align-self: flex-start;
}

.message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.message-avatar.has-image {
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.message-avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.message-content {
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.5;
}

.message-assistant .message-content {
  background: var(--bg);
  border-bottom-left-radius: 4px;
}

.message-user .message-content {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-bottom-right-radius: 4px;
}

.system-message {
  background: #fef3c7;
  color: #92400e;
  font-size: 14px;
  text-align: center;
  border-radius: var(--radius-sm);
  max-width: 100%;
}

/* Retry Error */
.retry-error-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #fef2f2 !important;
  color: #991b1b !important;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: #991b1b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.retry-btn:hover {
  background: #7f1d1d;
}

.retry-btn:active {
  transform: scale(0.97);
}

.retry-btn svg {
  flex-shrink: 0;
}

/* Typing Indicator */
.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat Input */
.chat-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

/* Final submit button - uses branding colors */
.final-submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.final-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}

.chat-input-container textarea {
  flex: 1;
  min-width: 0; /* Allow flex item to shrink below content size */
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-family: inherit;
  font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
  resize: none;
  max-height: 120px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.chat-input-container textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Complete Screen */
.complete-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.complete-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 24px;
}

.complete-screen h2 {
  margin-bottom: 12px;
}

.complete-screen > p {
  color: var(--text-secondary);
  max-width: 400px;
  margin-bottom: 30px;
}

.complete-summary {
  background: var(--bg);
  padding: 20px;
  border-radius: var(--radius-sm);
}

.complete-summary p {
  margin-bottom: 8px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Hide footer when chat is active to maximize space */
body:has(.chat-container:not(.hidden)) .footer {
  display: none;
}

/* Quiz Options */
.quiz-options {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-option:hover {
  border-color: var(--primary);
  background: #f5f3ff;
}

.quiz-option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.quiz-option input[type="radio"]:checked + .option-text {
  color: var(--primary);
  font-weight: 500;
}

.quiz-option input:disabled {
  opacity: 0.6;
}

.quiz-submit {
  margin-top: 8px;
  align-self: flex-start;
}

.quiz-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Anti-cheat: disable text selection on chat during interview */
.chat-messages.no-select,
.chat-messages.no-select * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 12px;
    padding-bottom: 8px;
  }

  .job-info,
  .cv-step,
  .complete-screen {
    padding: 24px;
  }

  /* Chat takes more screen on mobile */
  .chat-container {
    padding: 0;
    border-radius: var(--radius-sm);
    max-height: calc(100vh - 70px);
    max-height: calc(100dvh - 70px); /* Dynamic viewport height for mobile browsers */
  }

  .job-info h1 {
    font-size: 22px;
  }

  .btn-large {
    padding: 14px 30px;
    font-size: 16px;
  }

  .message {
    max-width: 90%;
  }

  /* Fix chat input text wrapping on mobile */
  .chat-input-container {
    padding: 12px;
    gap: 8px;
  }

  .chat-input-container textarea {
    width: 100%;
    min-width: 0;
    flex: 1 1 0;
    border-radius: 20px;
    padding: 10px 14px;
  }

  /* Smaller footer on mobile */
  .footer {
    padding: 12px;
    font-size: 12px;
  }
}

/* Job Closed Message */
.job-closed-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 60px 40px;
  text-align: center;
  margin-top: 40px;
}

.job-closed-container .closed-logo {
  max-width: 180px;
  max-height: 80px;
  object-fit: contain;
  margin-bottom: 24px;
}

.job-closed-container .closed-icon {
  color: var(--primary);
  margin-bottom: 24px;
}

.job-closed-container .closed-icon svg {
  opacity: 0.7;
}

.job-closed-container h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.job-closed-container .company {
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 24px;
}

.job-closed-container .closed-message {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  display: inline-block;
  margin-bottom: 16px;
  max-width: 480px;
}

.job-closed-container .closed-suggestion {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto;
}

/* ===========================================
   WHITE-LABEL BRANDING STYLES
   =========================================== */

/* Logo image support */
.logo-icon.has-image {
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.logo-icon .logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

/* Footer visibility for white-label */
.footer.hidden-branding {
  display: none;
}

/* ===========================================
   TEMPLATE: MODERN
   Clean, spacious, pill-shaped elements
   =========================================== */
/* Modern template: larger, more rounded logo */
.template-modern .job-logo-icon,
.template-modern .job-logo-svg {
  width: 56px;
  height: 56px;
}

.template-modern .job-logo-icon {
  border-radius: 16px;
}

.template-modern .job-logo-icon img {
  border-radius: 16px;
}

.template-modern .job-info,
.template-modern .cv-step,
.template-modern .chat-container,
.template-modern .complete-screen {
  border-radius: 24px;
}

.template-modern .message-content {
  border-radius: 24px;
}

.template-modern .message-assistant .message-content {
  border-bottom-left-radius: 8px;
}

.template-modern .message-user .message-content {
  border-bottom-right-radius: 8px;
}

.template-modern .btn {
  border-radius: 50px;
  padding: 14px 32px;
}

.template-modern .cv-upload-box {
  border-radius: 24px;
}

.template-modern .company-badge {
  border-radius: 50px;
  padding: 8px 20px;
}

.template-modern .chat-input-container textarea {
  border-radius: 32px;
}

/* ===========================================
   TEMPLATE: CORPORATE
   Professional, formal, square edges
   =========================================== */
/* Corporate template: square logo */
.template-corporate .job-logo-icon {
  border-radius: 4px;
}

.template-corporate .job-logo-icon img {
  border-radius: 4px;
}

.template-corporate .job-info,
.template-corporate .cv-step,
.template-corporate .chat-container,
.template-corporate .complete-screen {
  border-radius: 4px;
}

.template-corporate .message-content {
  border-radius: 4px;
}

.template-corporate .message-assistant .message-content {
  border-bottom-left-radius: 0;
}

.template-corporate .message-user .message-content {
  border-bottom-right-radius: 0;
}

.template-corporate .btn {
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.template-corporate .cv-upload-box {
  border-radius: 4px;
  border-style: solid;
}

.template-corporate .company-badge {
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.template-corporate .chat-avatar,
.template-corporate .message-avatar {
  border-radius: 4px;
}

.template-corporate .chat-input-container textarea {
  border-radius: 4px;
}

.template-corporate .send-btn {
  border-radius: 4px;
}

/* ===========================================
   TEMPLATE: MINIMAL
   Ultra-clean, text-focused, subtle styling
   =========================================== */
/* Minimal template: outline logo, no background */
.template-minimal .job-logo-icon {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.template-minimal .job-logo-icon.has-image {
  border: none;
}

.template-minimal .job-info,
.template-minimal .cv-step,
.template-minimal .chat-container,
.template-minimal .complete-screen {
  box-shadow: none;
  border: 1px solid var(--border);
}

.template-minimal .message-content {
  background: transparent;
  border-radius: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.template-minimal .message-assistant .message-content {
  background: transparent;
  border-bottom-left-radius: 0;
}

.template-minimal .message-user .message-content {
  background: transparent;
  border-bottom-right-radius: 0;
  color: var(--text);
}

.template-minimal .btn {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.template-minimal .btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  transform: none;
  box-shadow: none;
}

.template-minimal .btn-primary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.template-minimal .btn-primary:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.template-minimal .cv-upload-box {
  border-radius: 0;
  border-width: 1px;
}

.template-minimal .company-badge {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.template-minimal .chat-avatar,
.template-minimal .message-avatar {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.template-minimal .send-btn {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.template-minimal .send-btn:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.template-minimal .footer {
  font-size: 12px;
  opacity: 0.6;
}

/* Preview Mode Banner */
.preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.preview-banner span:first-child {
  font-weight: 600;
}

.preview-banner span:last-child {
  opacity: 0.9;
  font-size: 13px;
}

/* Offset container when preview banner is shown */
body:has(.preview-banner) .container {
  padding-top: 60px;
}

@media (max-width: 600px) {
  .preview-banner {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 8px 16px;
  }
}

/* ===========================================
   CONTACT CONFIRMATION FORM
   =========================================== */

/* Contact Form Card - matches recruiter editable forms */
.contact-form {
  margin-top: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.contact-field {
  margin-bottom: 12px;
}

.contact-field:last-child {
  margin-bottom: 0;
}

.contact-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.contact-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.contact-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}

/* Message buttons - same as recruiter */
.message-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.msg-btn {
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.msg-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.msg-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: white;
}

.msg-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  color: white;
}

.msg-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.msg-btn.confirmed {
  background: var(--success);
  color: white;
}

/* Confirmed state */
.contact-form.confirmed .contact-input {
  background: var(--bg);
  color: var(--text-secondary);
  pointer-events: none;
}

/* Button spinner */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ===========================================
   EMAIL VERIFICATION MODAL
   =========================================== */

.verification-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.verification-modal.hidden {
  display: none;
}

.verification-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.verification-modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.verification-step {
  padding: 32px;
}

.verification-step.hidden {
  display: none;
}

.verification-header {
  text-align: center;
  margin-bottom: 24px;
}

.verification-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.verification-header p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.masked-email {
  font-weight: 600;
  color: var(--primary);
}

.verification-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.verification-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.verification-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.verification-field label .required {
  color: var(--error);
}

.verification-field input {
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.verification-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.verification-field input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.verification-btn {
  margin-top: 8px;
  width: 100%;
  padding: 14px 24px;
}

.verification-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px;
  text-align: center;
  transition: color 0.2s;
}

.verification-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.verification-link:disabled {
  color: var(--text-secondary);
  cursor: not-allowed;
}

.verification-error {
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #991b1b;
  font-size: 14px;
  text-align: center;
}

.verification-error.hidden {
  display: none;
}

/* Code Input */
.code-input-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 16px;
}

.code-digit {
  width: 48px;
  height: 56px;
  font-size: 24px;
  font-weight: 700;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  caret-color: var(--primary);
}

.code-digit:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.code-digit.filled {
  border-color: var(--primary);
  background: #f5f3ff;
}

.code-digit.error {
  border-color: var(--error);
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.code-expiry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.code-expiry svg {
  color: var(--primary);
}

.code-expiry.warning {
  color: #92400e;
}

.code-expiry.warning svg {
  color: #f59e0b;
}

.code-expiry.danger {
  color: #991b1b;
}

.code-expiry.danger svg {
  color: var(--error);
}

/* Match verification modal radius to chat container on mobile */
@media (max-width: 640px) {
  .verification-modal-content {
    border-radius: var(--radius-sm);
  }
}

/* Mobile responsiveness for verification modal */
@media (max-width: 480px) {
  .verification-modal {
    padding: 16px;
    align-items: center;
  }

  .verification-modal-content {
    max-width: 100%;
    border-radius: var(--radius-sm);
    max-height: 90vh;
  }

  .verification-step {
    padding: 24px 20px 28px;
  }

  .code-input-container {
    gap: 6px;
  }

  .code-digit {
    width: 42px;
    height: 50px;
    font-size: 20px;
  }
}

/* ===========================================
   TALENT POOL OPT-IN MODAL
   =========================================== */

.talent-pool-content {
  max-width: 380px;
  text-align: center;
}

.talent-pool-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.talent-pool-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 16px 0 24px;
  line-height: 1.5;
}

.talent-pool-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.talent-pool-buttons .btn {
  width: 100%;
  padding: 14px 20px;
}

.verification-btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.verification-btn-outline:hover {
  background: var(--bg);
  border-color: var(--text-secondary);
}

.talent-pool-terms {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.talent-pool-terms a {
  color: var(--primary);
}

/* Interview Notice Modal */
.interview-notice-content {
  text-align: center;
  padding: 32px 28px;
  max-width: 380px;
}

.interview-notice-icon {
  color: var(--primary);
  margin-bottom: 12px;
}

.interview-notice-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.interview-notice-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.interview-notice-content .btn-primary {
  width: 100%;
  margin-bottom: 12px;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

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

/* Verification Method Toggle (Email/SMS) */
.verification-method-toggle {
  margin-top: 8px;
  margin-bottom: 4px;
}

.verification-method-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.verification-method-options {
  display: flex;
  gap: 8px;
}

.method-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.method-option:hover {
  border-color: var(--primary);
  color: var(--text);
}

.method-option.active {
  border-color: var(--primary);
  background: #f5f3ff;
  color: var(--primary);
}

/* AI Disclosure Modal */
.ai-disclosure-content {
  max-width: 420px;
  text-align: left;
}

.ai-disclosure-icon {
  text-align: center;
  margin-bottom: 8px;
  color: var(--primary);
}

.ai-disclosure-icon svg {
  display: inline-block;
  vertical-align: middle;
}

.ai-disclosure-content .verification-header {
  text-align: center;
}

.ai-disclosure-points {
  margin: 20px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-disclosure-point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.ai-disclosure-bullet {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.ai-disclosure-actions {
  text-align: center;
}

.ai-disclosure-actions .btn {
  width: 100%;
  padding: 14px 20px;
}

/* What happens next (completion screen) */
.what-happens-next {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Human Review Notice (EU AI Act) */
.human-review-notice {
  margin-top: 20px;
  width: 100%;
  max-width: 400px;
}

.human-review-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
}

.human-review-text a {
  color: var(--primary);
}

/* Feedback Request (Completion Screen) */
.feedback-request {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 400px;
}

.feedback-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.btn-feedback {
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-feedback:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-feedback:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.feedback-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
}

.feedback-result h4 {
  margin-bottom: 8px;
  color: var(--text);
}

.feedback-result ul {
  margin: 8px 0;
  padding-left: 20px;
}

.feedback-result li {
  margin-bottom: 4px;
  color: var(--text-secondary);
}
