:root {
  color-scheme: light;
  --page-bg: #ffffff;
  --panel-bg: #313849;
  --button-bg: #d37518;
  --button-bg-hover: #b96310;
  --text: #20242c;
  --muted: #626b78;
  --line: #d9dee7;
  --soft: #f5f6f8;
  --danger: #b42318;
  --danger-bg: #fff4f2;
  --success-bg: #fff8ef;
  --shadow: 0 18px 46px rgba(49, 56, 73, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

.page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  margin-bottom: 22px;
  padding: 30px;
  border-radius: 8px;
  background: var(--panel-bg);
  color: #ffffff;
}

.hero h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.upload-card {
  padding: 28px;
}

.upload-card-hidden {
  display: none;
}

.prep-block {
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.prep-block h2 {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.prep-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.prep-list,
.prep-warning {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.prep-warning {
  margin-top: 16px;
  background: #fff8ef;
}

.prep-list h3,
.prep-warning h3 {
  margin: 0 0 10px;
  color: #313849;
  font-size: 17px;
  line-height: 1.25;
}

.prep-block ul {
  margin: 0;
  padding-left: 20px;
}

.prep-block li {
  margin: 7px 0;
  line-height: 1.45;
}

.field {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--button-bg);
  outline: 3px solid rgba(211, 117, 24, 0.18);
}

input[readonly],
.input-locked {
  background: #f5f6f8;
  cursor: wait;
  pointer-events: none;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-dropzone {
  display: block;
  padding: 28px;
  border: 2px dashed #d37518;
  border-radius: 14px;
  background: #fff8ef;
  cursor: pointer;
  transition: 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  background: #fff2df;
  border-color: #b96310;
}

.upload-dropzone-title {
  display: block;
  color: #313849;
  font-weight: 700;
  font-size: 17px;
}

.upload-dropzone-subtitle {
  display: block;
  margin-top: 6px;
  color: #626b78;
  font-size: 14px;
}

.upload-file-name {
  display: block;
  margin-top: 14px;
  color: #d37518;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.upload-error {
  min-height: 20px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
}

.captcha-block {
  margin: 18px 0;
  display: flex;
  justify-content: flex-start;
}

.captcha-locked {
  opacity: 0.72;
  pointer-events: none;
}

.captcha-error {
  margin-top: 10px;
  color: #b42318;
  background: #fff4f2;
  border: 1px solid #f4cccc;
  padding: 10px 12px;
  border-radius: 8px;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  padding: 12px 22px;
  background: var(--button-bg);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.submit-button:hover {
  background: var(--button-bg-hover);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 22px;
  background: #ffffff;
  color: #313849;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover {
  background: var(--soft);
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 6px;
  line-height: 1.45;
}

.notice-error {
  border: 1px solid #f1b8b2;
  background: var(--danger-bg);
  color: var(--danger);
}

.notice-success {
  border: 1px solid #d7dfce;
  background: #f5f9f1;
  color: #2f5f25;
  font-size: 18px;
  font-weight: 700;
}

.notice-info {
  margin-top: 24px;
  border: 1px solid #c9d8e8;
  background: #f3f7fb;
  color: #254767;
}

.processing-state {
  margin-top: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #d9dee7;
  border-left: 5px solid #d37518;
  border-radius: 12px;
  background: #fff8ef;
  display: flex;
  gap: 14px;
  align-items: center;
}

.processing-state p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.upload-progress {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #d9dee7;
  border-radius: 12px;
  background: #fff8ef;
}

.upload-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: #313849;
}

.upload-progress-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4d2ad;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: #d37518;
  transition: width 0.2s ease;
}

.upload-progress p {
  margin: 10px 0 0;
  color: #626b78;
}

.upload-progress.is-processing .upload-progress-fill {
  animation: progress-pulse 1.2s ease-in-out infinite;
}

@keyframes progress-pulse {
  0% {
    opacity: 0.65;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.65;
  }
}

.spinner {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 3px solid #f4d2ad;
  border-top-color: #d37518;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.result-card {
  margin-top: 24px;
  padding: 28px;
}

.revision-card {
  margin-top: 24px;
  padding: 28px;
}

.revision-heading {
  margin-bottom: 22px;
}

.revision-heading h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.revision-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.revision-prep {
  margin-bottom: 22px;
  box-shadow: none;
}

.revision-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.revision-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn-revision {
  margin-top: 16px;
}

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.result-heading h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.status {
  flex: 0 0 auto;
  max-width: 320px;
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--success-bg);
  color: var(--button-bg);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.score-summary {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.score-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.score-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
  color: #313849;
}

.score-value {
  font-size: 30px;
  line-height: 1.15;
}

.score-separator {
  color: var(--muted);
  font-size: 22px;
}

.score-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.score-low {
  background: #F4CCCC;
}

.score-mid {
  background: #FFF2CC;
}

.score-good {
  background: #DDEBF7;
}

.score-excellent {
  background: #D9EAD3;
}

.score-empty {
  background: var(--soft);
}

.result-meta {
  margin-top: 24px;
}

.result-meta h3,
.recommendations h3 {
  margin: 0 0 14px;
  color: #313849;
  font-size: 20px;
  line-height: 1.25;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.meta-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.meta-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.meta-value {
  display: block;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.recommendations {
  margin-top: 24px;
}

.recommendation-grid {
  display: grid;
  gap: 12px;
}

.recommendation-card {
  padding: 16px 18px;
  border: 1px solid #d9dee7;
  border-left: 5px solid #d37518;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(49, 56, 73, 0.06);
}

.recommendation-title {
  margin-bottom: 6px;
  color: #313849;
  font-weight: 700;
  font-size: 16px;
}

.recommendation-description {
  color: #20242c;
  line-height: 1.55;
}

@media (max-width: 680px) {
  .page {
    width: min(100% - 24px, 860px);
    padding: 24px 0;
  }

  .hero,
  .upload-card,
  .result-card,
  .revision-card,
  .prep-block {
    padding: 20px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .result-heading {
    display: block;
  }

  .status {
    display: inline-block;
    max-width: 100%;
    margin-top: 12px;
  }

  .score-value {
    font-size: 26px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .prep-grid {
    grid-template-columns: 1fr;
  }

  .submit-button,
  .secondary-button {
    width: 100%;
  }

  .revision-actions {
    display: grid;
    gap: 10px;
  }
}
