:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --brand-primary: #22284e;
  --brand-primary-dark: #161a33;
  --brand-accent: #e76045;
  --brand-accent-light: #f18b72;
  --brand-surface: #f4f5f9;
  --brand-surface-alt: #e8e6ec;
  --brand-border: #d5ccd1;
  --brand-muted: #6b6f8d;
  --brand-muted-light: #c1a5a9;
  --brand-text: #212438;
  --brand-text-soft: #4a4f6d;
  background-color: var(--brand-surface);
  color: var(--brand-text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-content: center;
  padding: 32px 16px;
  background-color: var(--brand-surface);
  color: var(--brand-text);
  position: relative;
  overflow-x: hidden;
}

.how-it-works-button {
  position: fixed;
  top: 24px;
  left: 24px;
  background: var(--brand-accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(231, 96, 69, 0.35);
  z-index: 10;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.how-it-works-button:hover {
  background: var(--brand-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(231, 96, 69, 0.35);
}

body::before {
  content: "";
  position: fixed;
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  background: var(--brand-primary);
  opacity: 0.12;
  filter: blur(6px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  bottom: -140px;
  left: -140px;
  width: 320px;
  height: 320px;
  background: var(--brand-accent);
  opacity: 0.12;
  filter: blur(10px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1100px;
  width: 100%;
}

.form-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 28px 60px rgba(34, 40, 78, 0.15);
  border: 1px solid var(--brand-border);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-accent);
  letter-spacing: -0.01em;
}

header p {
  margin-top: 8px;
  color: var(--brand-text-soft);
}

.steps-indicator {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.steps-indicator span {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(34, 40, 78, 0.08);
  color: var(--brand-text-soft);
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
}

.steps-indicator span.active {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(34, 40, 78, 0.25), inset 0 -4px 0 var(--brand-accent);
}

.form-step {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.form-step.active {
  display: flex;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two-columns {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--brand-primary);
}

input,
textarea {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--brand-border);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  background: #fff;
  color: var(--brand-text);
}

input:focus,
textarea:focus {
  outline: 2px solid var(--brand-accent);
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgba(231, 96, 69, 0.15);
}

.file-input input {
  padding: 10px;
}

.helper {
  margin: 0;
  font-size: 0.95rem;
  color: var(--brand-muted);
}

.consent-status {
  margin: -12px 0 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(34, 40, 78, 0.08);
  color: var(--brand-primary);
  font-weight: 600;
  text-align: center;
}

.consent-note {
  margin: 0;
  font-size: 0.95rem;
  color: var(--brand-text-soft);
  line-height: 1.5;
}

.consent-note a {
  color: var(--brand-accent);
  font-weight: 600;
  text-decoration: none;
}

.consent-note a:hover {
  text-decoration: underline;
}

.item-block {
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.9);
  position: relative;
  box-shadow: 0 10px 25px rgba(34, 40, 78, 0.08);
}

.item-block:not(:last-child) {
  margin-bottom: 16px;
}

.remove-item {
  align-self: flex-start;
  margin-top: -4px;
}

.ghost,
.primary {
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

.ghost {
  background: transparent;
  color: var(--brand-accent);
  border: 1px solid rgba(231, 96, 69, 0.4);
}

.ghost:hover {
  background: rgba(231, 96, 69, 0.08);
}

.ghost.danger {
  color: #d4493f;
  border-color: rgba(212, 73, 63, 0.45);
}

.ghost.danger:hover {
  background: rgba(212, 73, 63, 0.12);
}

.primary {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 18px 40px rgba(34, 40, 78, 0.22), inset 0 -4px 0 var(--brand-accent);
  border: none;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 46px rgba(34, 40, 78, 0.3), inset 0 -4px 0 var(--brand-accent);
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.form-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.form-navigation button.hidden {
  display: none;
}

.preview-wrapper {
  border: 1px solid rgba(34, 40, 78, 0.08);
  border-radius: 20px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.cv-preview {
  background: #fff;
  border-radius: 18px;
  padding: 36px;
  box-shadow: inset 0 0 0 1px rgba(34, 40, 78, 0.08);
  display: grid;
  gap: 16px;
}

.cv-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 24px;
  align-items: center;
}

.cv-profession {
  margin: 4px 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-primary);
}

.cv-header img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 18px;
  border: 3px solid var(--brand-accent);
  box-shadow: 0 12px 24px rgba(34, 40, 78, 0.18);
}

.photo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 18px;
  border: 2px dashed rgba(34, 40, 78, 0.25);
  display: grid;
  place-content: center;
  color: rgba(34, 40, 78, 0.45);
  font-weight: 600;
  text-align: center;
}

.cv-section h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cv-section ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.cv-section li {
  line-height: 1.5;
}

.company-footer {
  border-top: 1px solid var(--brand-border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.company-footer img {
  height: 48px;
  object-fit: contain;
}

.company-footer .info {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--brand-muted);
}

.company-footer .info strong {
  font-size: 1rem;
  color: var(--brand-primary);
}

.company-footer .info a {
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 600;
}

.company-footer .info a:hover {
  text-decoration: underline;
}

.import-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 40, 78, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1100;
}

.import-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.import-dialog {
  background: #ffffff;
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  padding: 32px;
  box-shadow: 0 40px 70px rgba(34, 40, 78, 0.28);
  border: 1px solid var(--brand-border);
  display: grid;
  gap: 18px;
  text-align: left;
}

.import-dialog h2 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--brand-primary);
}

.import-dialog p {
  margin: 0;
  color: var(--brand-text-soft);
  line-height: 1.55;
}

.import-dropzone {
  border: 2px dashed rgba(34, 40, 78, 0.4);
  border-radius: 18px;
  padding: 32px 24px;
  background: rgba(34, 40, 78, 0.05);
  display: grid;
  gap: 12px;
  align-items: center;
  justify-items: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.import-dropzone strong {
  font-size: 1.05rem;
  color: var(--brand-primary);
}

.import-hint {
  color: var(--brand-text-soft);
  font-size: 0.9rem;
}

.import-dropzone.drag-active {
  border-color: var(--brand-accent);
  background: rgba(231, 96, 69, 0.1);
  transform: translateY(-2px);
}

.import-overlay.loading .import-dropzone,
.import-dropzone.loading {
  pointer-events: none;
  opacity: 0.65;
}

.import-status {
  margin: 0;
  color: var(--brand-text-soft);
  font-size: 0.95rem;
  text-align: center;
}

.import-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 40, 78, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
}

.consent-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.consent-dialog {
  background: #ffffff;
  border-radius: 18px;
  max-width: 420px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 30px 60px rgba(34, 40, 78, 0.25);
  border: 1px solid var(--brand-border);
  display: grid;
  gap: 16px;
}

.consent-dialog h2 {
  margin: 0;
  font-size: 1.4rem;
  color: var(--brand-primary);
}

.consent-dialog p {
  margin: 0;
  color: var(--brand-text-soft);
  line-height: 1.5;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--brand-primary);
  color: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(34, 40, 78, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.toast.error {
  background: #d64545;
  box-shadow: 0 20px 40px rgba(214, 69, 69, 0.25);
}

@media (max-width: 768px) {
  body {
    padding: 16px;
  }

  .form-card {
    padding: 24px;
  }

  .cv-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .cv-header img {
    justify-self: center;
  }

  .company-footer {
    flex-direction: column;
    text-align: center;
  }
}

.hidden {
  display: none !important;
}

body.admin-body {
  margin: 0;
  min-height: 100vh;
  display: block;
  place-content: initial;
  padding: 32px 16px;
  background-color: var(--brand-surface);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--brand-text);
  position: relative;
  overflow-x: hidden;
}

body.admin-body::before,
body.admin-body::after {
  display: none;
}

.admin-container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.admin-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.admin-header-actions {
  display: flex;
  gap: 12px;
}

.admin-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 22px 55px rgba(34, 40, 78, 0.16);
  border: 1px solid var(--brand-border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-form textarea {
  min-height: 110px;
}

.helper-list-wrapper {
  margin-top: 8px;
}

.helper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.helper-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  background: #fff;
}

.helper-list li .meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.helper-list li .meta strong {
  font-weight: 600;
  color: var(--brand-primary);
}

.helper-list li .meta small {
  color: var(--brand-muted);
  font-size: 0.85rem;
}

.helper-list li.empty {
  justify-content: center;
  color: var(--brand-muted);
  background: var(--brand-surface);
  border-style: dashed;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--brand-border);
  background: rgba(255, 255, 255, 0.85);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table thead {
  background: rgba(34, 40, 78, 0.08);
  color: var(--brand-primary);
}

table th,
table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--brand-border);
  text-align: left;
  vertical-align: middle;
}

table tbody tr:nth-child(even) {
  background: rgba(34, 40, 78, 0.03);
}

table td.empty {
  text-align: center;
  color: var(--brand-muted);
  font-style: italic;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.table-actions-placeholder {
  color: var(--brand-muted);
  font-size: 0.85rem;
}

.ghost.small {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.primary.small {
  padding: 10px 18px;
  font-size: 0.9rem;
  box-shadow: 0 14px 28px rgba(34, 40, 78, 0.18), inset 0 -4px 0 var(--brand-accent);
}

.recipient-info {
  font-size: 0.9rem;
  color: var(--brand-text-soft);
  background: rgba(34, 40, 78, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
}

.admin-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(7, 12, 46, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1200;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.admin-overlay.visible {
  opacity: 1;
}

.admin-dialog {
  width: min(960px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 28px 60px rgba(18, 22, 58, 0.28);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-dialog-header h2 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--brand-primary);
}

.admin-dialog-subtitle {
  margin: 4px 0 0;
  color: var(--brand-text-soft);
  font-size: 0.95rem;
}

.admin-dropzone {
  border: 2px dashed rgba(34, 40, 78, 0.25);
  border-radius: 18px;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: rgba(245, 247, 255, 0.85);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.admin-dropzone strong {
  font-size: 1.1rem;
  color: var(--brand-primary);
}

.admin-dropzone-hint {
  color: var(--brand-text-soft);
  font-size: 0.9rem;
}

.admin-dropzone.dragging {
  border-color: var(--brand-primary);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
}

.admin-dropzone.loading {
  opacity: 0.6;
  pointer-events: none;
}

.admin-dropzone-status {
  margin: 0;
  font-size: 0.95rem;
  color: var(--brand-text-soft);
}

.admin-dropzone-status.error {
  color: var(--brand-danger);
}

.bulk-parser-results {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bulk-parser-results.empty {
  color: var(--brand-text-soft);
  font-style: italic;
}

.bulk-result {
  border: 1px solid rgba(34, 40, 78, 0.12);
  border-radius: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bulk-result.error {
  border-color: rgba(238, 68, 102, 0.35);
  background: rgba(255, 244, 247, 0.9);
}

.bulk-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bulk-result-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--brand-primary);
}

.bulk-result-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.bulk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(34, 40, 78, 0.08);
  color: var(--brand-primary);
}

.bulk-badge.success {
  background: rgba(34, 197, 94, 0.15);
  color: #1a7f3b;
}

.bulk-badge.warning {
  background: rgba(250, 179, 0, 0.18);
  color: #9b6500;
}

.bulk-badge.error {
  background: rgba(238, 68, 102, 0.15);
  color: var(--brand-danger);
}

.bulk-badge.info {
  background: rgba(64, 132, 255, 0.15);
  color: #1f5ca8;
}

.bulk-result-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 18px;
  margin: 0;
}

.bulk-result-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bulk-result-field dt {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-text-soft);
}

.bulk-result-field dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--brand-text);
  white-space: pre-wrap;
}

.bulk-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bulk-result-warning {
  margin: 0;
  font-size: 0.9rem;
  color: var(--brand-danger);
  background: rgba(238, 68, 102, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}

.bulk-result details {
  background: rgba(34, 40, 78, 0.04);
  border-radius: 12px;
  padding: 12px 14px;
}

.bulk-result details + details {
  margin-top: 8px;
}

.bulk-result summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-primary);
}

.bulk-result pre {
  margin: 12px 0 0;
  max-height: 280px;
  overflow-y: auto;
  font-family: "IBM Plex Mono", SFMono-Regular, "Courier New", monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  .admin-dialog {
    padding: 22px;
  }

  .bulk-result-info {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .bulk-result-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  table th,
  table td {
    font-size: 0.85rem;
    padding: 10px;
  }
}
