*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f4f2ee;
  --bg-accent: #e8f4f2;
  --surface: #ffffff;
  --text: #14121a;
  --muted: #5c5866;
  --muted-light: #8a8594;
  --border: #e6e3df;
  --accent: #0c8c7f;
  --accent-deep: #06786d;
  --accent-glow: rgba(12, 140, 127, 0.35);
  --error: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(20, 18, 26, 0.04);
  --shadow-md: 0 4px 14px rgba(20, 18, 26, 0.07), 0 2px 4px rgba(20, 18, 26, 0.04);
  --shadow-lg: 0 12px 40px rgba(20, 18, 26, 0.08);
  --radius: 16px;
  --radius-input: 10px;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Outfit", var(--font-ui);
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--bg-accent), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(12, 140, 127, 0.08), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 2rem) 3.5rem;
}

.header {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
  padding: 0 0.5rem;
}

.header h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text);
}

.tagline {
  margin: 0 auto;
  max-width: 28rem;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 400;
}

.file-warning {
  margin: 1.25rem auto 0;
  max-width: 38rem;
  padding: 0.875rem 1.125rem;
  font-size: 0.875rem;
  color: #7c2d12;
  background: #fff8f3;
  border: 1px solid #fcd9c0;
  border-radius: 12px;
  line-height: 1.5;
}

.file-warning code {
  font-size: 0.8125rem;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
}

.layout {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 2rem;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(230, 227, 223, 0.95);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: var(--shadow-md);
}

.panel h2 {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.field {
  margin-bottom: 1.25rem;
}

.field:last-of-type {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.45;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: #faf9f7;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-light);
}

input:hover,
textarea:hover {
  border-color: #d4d0ca;
  background: #fff;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

textarea {
  resize: vertical;
  min-height: 5.5rem;
}

.api-details {
  margin: 1.5rem 0 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.api-details summary {
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
  letter-spacing: 0.02em;
}

.api-details summary:hover {
  color: var(--text);
}

.api-details[open] summary {
  margin-bottom: 0.875rem;
}

.hint {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
}

.hint code {
  font-size: 0.78rem;
  padding: 0.1rem 0.35rem;
  background: #f0eeeb;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  cursor: pointer;
  margin-top: 0.625rem;
}

.checkbox input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.error {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.875rem;
  color: var(--error);
  background: #fef5f5;
  border: 1px solid #f5cfcf;
  border-radius: var(--radius-input);
  line-height: 1.45;
}

.btn-primary {
  --btn-shadow: 0 4px 14px rgba(12, 140, 127, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.9rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  background: linear-gradient(165deg, #12a396 0%, var(--accent) 45%, var(--accent-deep) 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 6px 22px rgba(12, 140, 127, 0.42);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(12, 140, 127, 0.3);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  transition: transform 0.2s ease;
}

.btn-primary:hover:not(:disabled) .btn-icon-wrap {
  transform: translateX(3px);
}

.btn-loading[hidden],
.btn-label[hidden] {
  display: none;
}

.result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.result-header h2 {
  margin: 0;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--accent-deep);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}

.btn-download:hover:not(:disabled) {
  border-color: var(--accent);
  background: #f6fdfc;
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(12, 140, 127, 0.14);
}

.btn-download:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

.btn-download:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-download-icon {
  flex-shrink: 0;
}

.result-panel {
  min-height: 340px;
}

.resume-output {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

.resume-output.empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(180deg, #faf9f7 0%, #f5f3ef 100%);
  border-radius: 12px;
  border: 1px dashed #d9d4cd;
}

.resume-output .placeholder {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  max-width: 22rem;
  line-height: 1.55;
}

.resume-output:not(.empty) {
  padding: 1.5rem 1.25rem;
  background: #faf9f7;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.resume-output h1,
.resume-output h2,
.resume-output h3 {
  font-family: var(--font-display);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.25;
}

.resume-output h1 {
  font-size: 1.5rem;
  margin-top: 0;
  text-align: center;
  letter-spacing: -0.02em;
}

.resume-output h2 {
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-deep);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.resume-output h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.resume-output p {
  margin: 0.5rem 0;
}

.resume-output ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.25rem;
}

.resume-output li {
  margin: 0.3rem 0;
}

.resume-output strong {
  font-weight: 600;
}

.resume-output hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.footer {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.55;
  border-top: 1px solid rgba(230, 227, 223, 0.8);
}

.footer code {
  font-size: 0.78rem;
  padding: 0.1rem 0.35rem;
  background: #ebe8e4;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}
