/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    min-height: 100vh;
    background: #0a0a0f;
    color: #e2e8f0;
    font-family: 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .4; }
}
@keyframes scoreReveal {
    from { stroke-dashoffset: 283; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

/* ===== Header ===== */
.header {
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: 16px 24px;
    background: rgba(255,255,255,.02);
}
.header-inner {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
.logo-text {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -.02em;
}
.tagline {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ===== Progress ===== */
.progress-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 24px 0;
}
.progress-track {
    display: flex;
    align-items: center;
}
.progress-labels {
    display: flex;
    margin-top: 8px;
}
.progress-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    transition: all .3s ease;
}
.progress-dot.active  { background: #6366f1; color: #fff; border: 2px solid #818cf8; }
.progress-dot.done    { background: #6366f1; color: #fff; border: 2px solid transparent; }
.progress-dot.pending { background: rgba(255,255,255,.1); color: rgba(255,255,255,.35); border: 2px solid transparent; }
.progress-line {
    flex: 1; height: 2px; min-width: 16px;
}
.progress-line.done    { background: #6366f1; }
.progress-line.pending { background: rgba(255,255,255,.08); }
.progress-label {
    font-size: 11px;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.progress-label.on  { color: rgba(255,255,255,.75); }
.progress-label.off { color: rgba(255,255,255,.25); }

/* ===== Error ===== */
.error-box {
    max-width: 820px;
    margin: 16px auto 0;
    padding: 12px 16px;
    background: rgba(239,68,68,.08);
    border: 1px solid rgba(239,68,68,.25);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.error-close {
    background: none; border: none; color: #fca5a5; font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1;
}

/* ===== Content ===== */
.content {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 24px 80px;
}
.step { animation: fadeIn .4s ease; }

/* ===== Typography ===== */
.step-title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -.02em;
}
.step-desc {
    font-size: 14px;
    color: rgba(255,255,255,.5);
    line-height: 1.65;
    margin-bottom: 24px;
}
.section-label {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.45);
    margin-bottom: 12px;
}

/* ===== Drop zone ===== */
.drop-zone {
    border: 2px dashed rgba(99,102,241,.3);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .25s ease;
    background: rgba(99,102,241,.03);
    margin-bottom: 20px;
}
.drop-zone:hover {
    border-color: rgba(99,102,241,.55);
    background: rgba(99,102,241,.06);
}
.drop-zone .icon { color: rgba(255,255,255,.25); margin-bottom: 8px; }
.drop-zone .hint { color: rgba(255,255,255,.55); font-size: 14px; }
.drop-zone .sub  { color: rgba(255,255,255,.3); font-size: 12px; margin-top: 4px; }

/* ===== Preview ===== */
.preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: rgba(255,255,255,.65);
    font-size: 14px;
}
.preview-box {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 16px;
    font-size: 12px;
    font-family: 'Space Mono', monospace;
    color: rgba(255,255,255,.5);
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ===== Form elements ===== */
.textarea {
    width: 100%;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    padding: 14px 16px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    resize: vertical;
    line-height: 1.6;
    margin-bottom: 16px;
    transition: border-color .2s, box-shadow .2s;
}
.textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.textarea::placeholder { color: rgba(255,255,255,.25); }

/* ===== Buttons ===== */
.btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all .2s ease;
    box-shadow: 0 2px 8px rgba(99,102,241,.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,.4); }
.btn-primary:disabled { opacity: .4; pointer-events: none; }
.btn-primary.green { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 2px 8px rgba(34,197,94,.3); }
.btn-secondary {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all .2s ease;
}
.btn-secondary:hover { background: rgba(255,255,255,.1); }
.btn-link {
    background: none;
    border: none;
    color: rgba(255,255,255,.4);
    font-size: 13px;
    cursor: pointer;
    padding: 8px 0;
    font-family: 'DM Sans', sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ===== Score circle ===== */
.score-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.score-header .info { flex: 1; min-width: 250px; }

/* ===== Cards & Grids ===== */
.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.match-card {
    background: rgba(34,197,94,.06);
    border: 1px solid rgba(34,197,94,.15);
    border-radius: 10px;
    padding: 12px 14px;
}
.match-card .area { font-weight: 600; color: #22c55e; font-size: 13px; margin-bottom: 4px; }
.match-card .evidence { font-size: 12px; color: rgba(255,255,255,.55); line-height: 1.5; }

.gap-card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.gap-card .top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.gap-card .area { font-weight: 600; font-size: 14px; }
.gap-card .desc { font-size: 12px; color: rgba(255,255,255,.45); line-height: 1.5; }

.badge {
    font-size: 10px;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    display: inline-block;
}
.badge-critical { background: rgba(239,68,68,.15); color: #ef4444; }
.badge-high     { background: rgba(249,115,22,.15); color: #f97316; }
.badge-medium   { background: rgba(234,179,8,.15);  color: #eab308; }

/* ===== Details / accordion ===== */
.details-block {
    margin-bottom: 20px;
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    overflow: hidden;
}
.details-block summary {
    padding: 14px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.65);
    list-style: none;
}
.details-block summary::marker,
.details-block summary::-webkit-details-marker { display: none; }
.details-block summary::before { content: '▸ '; }
.details-block[open] summary::before { content: '▾ '; }
.details-content {
    padding: 0 16px 16px;
    font-size: 13px;
    color: rgba(255,255,255,.5);
    line-height: 1.7;
    white-space: pre-wrap;
}
.suggestion-item {
    margin-bottom: 8px;
    padding-left: 16px;
    border-left: 2px solid rgba(99,102,241,.3);
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255,255,255,.65);
}

/* ===== Questions ===== */
.q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.q-counter {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: rgba(255,255,255,.4);
}
.q-progress {
    height: 3px;
    background: rgba(255,255,255,.08);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}
.q-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #22c55e);
    border-radius: 2px;
    transition: width .4s ease;
}
.question-card {
    background: rgba(99,102,241,.04);
    border: 1px solid rgba(99,102,241,.15);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    animation: slideUp .3s ease;
}
.question-text {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    line-height: 1.6;
    margin: 12px 0 20px;
}
.dot-nav {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.nav-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all .2s ease;
    padding: 0;
}
.nav-dot.answered { background: #22c55e; }
.nav-dot.current  { background: #6366f1; }
.nav-dot.empty    { background: rgba(255,255,255,.15); }

/* ===== Loading ===== */
.loading-center {
    text-align: center;
    padding-top: 60px;
    animation: fadeIn .4s ease;
}
.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}
.pulse-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
}
.pulse-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #6366f1;
    animation: pulse 1.4s ease infinite;
}
.pulse-dot:nth-child(2) { animation-delay: .2s; }
.pulse-dot:nth-child(3) { animation-delay: .4s; }

/* ===== Resume output ===== */
.resume-output {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
}
.resume-output pre {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: rgba(255,255,255,.75);
    white-space: pre-wrap;
    line-height: 1.7;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .header-inner { flex-direction: column; gap: 4px; }
    .tagline { display: none; }
    .score-header { flex-direction: column; align-items: center; text-align: center; }
    .progress-label { font-size: 9px; }
    .step-title { font-size: 20px; }
}
