/* ============================================
   AIRezume — Clean Minimal Design System
   ============================================ */

:root {
    --color-bg: #ffffff;
    --color-bg-subtle: #f8f9fb;
    --color-bg-muted: #f1f3f5;
    --color-text: #1a1a2e;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-border: #e5e7eb;
    --color-border-light: #f0f0f0;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-success: #059669;
    --color-danger: #dc2626;
    --color-ai: #7c3aed;
    --color-ai-hover: #6d28d9;
    --color-ai-light: #f5f3ff;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 720px;
    --max-width-wide: 1100px;
}

/* ---- Base ---- */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text);
}

h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.625rem; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; font-weight: 600; }

p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--color-primary-hover);
}

/* ---- Header ---- */

.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text);
}

.site-logo:hover {
    color: var(--color-text);
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: var(--color-text);
    color: #fff;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links .nav-link {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0;
}

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

/* ---- Buttons ---- */

.btn-primary-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: var(--color-text);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
}

.btn-primary-sm:hover {
    background: #333;
    color: #fff;
}

.btn-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--color-text);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
}

.btn-main:hover {
    background: #333;
    color: #fff;
    transform: translateY(-1px);
}

.btn-main:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

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

.btn-ai {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-ai-light);
    color: var(--color-ai);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-ai:hover {
    background: var(--color-ai);
    color: #fff;
}

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

/* ---- Footer ---- */

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 40px 0;
    margin-top: 80px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 8px;
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.footer-links a:hover {
    color: var(--color-text);
}

/* ---- Wizard Progress ---- */

.wizard-progress {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 0 0;
}

.wizard-steps {
    display: flex;
    gap: 4px;
}

.wizard-step {
    flex: 1;
    height: 4px;
    background: var(--color-bg-muted);
    border-radius: 2px;
    transition: background 0.3s;
}

.wizard-step.active {
    background: var(--color-text);
}

.wizard-step.completed {
    background: var(--color-success);
}

.wizard-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ---- Form Card ---- */

.form-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 0 80px;
}

.form-section h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.form-section .form-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-group .form-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--color-text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-check label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    margin: 0;
}

.field-validation-error {
    display: block;
    font-size: 0.8rem;
    color: var(--color-danger);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- Form Actions ---- */

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-light);
}

.form-actions-right {
    display: flex;
    gap: 12px;
}

/* ---- Suggestions Panel ---- */

.suggestions-panel {
    background: var(--color-ai-light);
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.suggestions-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-ai);
    margin-bottom: 10px;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suggestion-chip {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.suggestion-chip:hover {
    background: var(--color-ai);
    color: #fff;
    border-color: var(--color-ai);
}

/* Inline suggestion chips (inside form fields) */

.exp-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.suggestion-chip-inline {
    padding: 4px 10px;
    background: var(--color-ai-light);
    color: var(--color-ai);
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}

.suggestion-chip-inline:hover {
    background: var(--color-ai);
    color: #fff;
}

/* ---- Dynamic List ---- */

.dynamic-list-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    position: relative;
    background: var(--color-bg);
}

.dynamic-list-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dynamic-list-item .item-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.btn-remove-item {
    padding: 4px 12px;
    font-size: 0.8rem;
    color: var(--color-danger);
    background: none;
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.btn-remove-item:hover {
    opacity: 1;
}

.btn-add-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    color: var(--color-primary);
    background: none;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    justify-content: center;
}

.btn-add-item:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

/* ---- Template Select ---- */

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.template-card {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: var(--color-text-muted);
    box-shadow: var(--shadow-md);
}

.template-card.selected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.template-card img {
    width: 100%;
    aspect-ratio: 210 / 297;
    object-fit: cover;
    background: var(--color-bg-muted);
}

.template-card .template-name {
    padding: 12px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ---- Tags Input ---- */

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    min-height: 44px;
    align-items: center;
    cursor: text;
}

.tags-container:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--color-bg-muted);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--color-text);
}

.tag-remove {
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1;
}

.tag-remove:hover {
    color: var(--color-danger);
}

.tag-input {
    border: none;
    outline: none;
    font-size: 0.9rem;
    min-width: 120px;
    flex: 1;
    padding: 2px 0;
    font-family: var(--font-sans);
}

.ai-suggested-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.ai-suggested-tag {
    padding: 4px 12px;
    background: var(--color-ai-light);
    color: var(--color-ai);
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.ai-suggested-tag:hover {
    background: var(--color-ai);
    color: #fff;
}

/* ---- Checkout ---- */

.plan-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.plan-card {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.plan-card:hover {
    border-color: var(--color-text-muted);
}

.plan-card.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.plan-card .plan-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.plan-card .plan-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
}

.plan-card .plan-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.plan-card .plan-features {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-align: left;
    list-style: none;
    padding: 0;
}

.plan-card .plan-features li {
    padding: 3px 0;
}

.plan-card .plan-features li::before {
    content: "\2713 ";
    color: var(--color-success);
    font-weight: 600;
}

/* ---- Hero ---- */

.hero {
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    letter-spacing: -0.03em;
    max-width: 700px;
    margin: 0 auto 16px;
}

.hero p {
    font-size: 1.15rem;
    max-width: 520px;
    margin: 0 auto 32px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ---- Landing Sections ---- */

.section {
    padding: 64px 0;
}

.section-alt {
    background: var(--color-bg-subtle);
}

.section-title {
    text-align: center;
    margin-bottom: 48px;
}

.section-title h2 {
    margin-bottom: 8px;
}

.section-title p {
    max-width: 520px;
    margin: 0 auto;
}

/* Steps */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.step-card {
    text-align: center;
    padding: 32px 24px;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-bg-muted);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin: 0 auto 16px;
}

.step-card h3 {
    margin-bottom: 8px;
}

.step-card p {
    font-size: 0.9rem;
}

/* Benefits */

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.benefit-card {
    padding: 28px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.benefit-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 14px;
}

.benefit-card h4 {
    margin-bottom: 6px;
}

.benefit-card p {
    font-size: 0.9rem;
    margin: 0;
}

/* FAQ */

.faq-list {
    max-width: var(--max-width);
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    font-family: var(--font-sans);
}

.faq-question::after {
    content: "+";
    font-size: 1.4rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-left: 16px;
    transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
    content: "\2212";
}

.faq-answer {
    display: none;
    padding-bottom: 20px;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    display: block;
}

/* CTA Final */

.cta-section {
    text-align: center;
    padding: 64px 0;
    background: var(--color-bg-subtle);
    border-radius: var(--radius-lg);
    margin: 0 auto;
    max-width: var(--max-width-wide);
}

/* Trust */

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.trust-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ---- Preview ---- */

.preview-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0 80px;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.preview-frame {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: #fff;
}

/* ---- Loading Spinner ---- */

.ai-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-ai);
}

.ai-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-ai-light);
    border-top-color: var(--color-ai);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ---- Live Preview Split ---- */

.split-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 64px);
}

.split-form {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 0 16px;
}

.split-preview {
    width: 42%;
    max-width: 620px;
    min-width: 380px;
    flex-shrink: 0;
    background: var(--color-bg-subtle);
    border-left: 1px solid var(--color-border);
    overflow-y: auto;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

.split-preview-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--color-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.split-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.split-preview-frame {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transform-origin: top left;
    /* 800px resume width scaled to fit preview panel */
    width: 800px;
}

.preview-template-switch {
    display: flex;
    gap: 4px;
}

.preview-template-btn {
    padding: 3px 10px;
    font-size: 0.72rem;
    background: var(--color-bg-muted);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.15s;
}

.preview-template-btn.active,
.preview-template-btn:hover {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}

/* Mobile: toggle button instead of split */
.mobile-preview-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-text);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    align-items: center;
    justify-content: center;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }

    .hero { padding: 48px 0; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }

    .steps-grid { grid-template-columns: 1fr; gap: 16px; }
    .benefits-grid { grid-template-columns: 1fr; }
    .plan-cards { grid-template-columns: 1fr; }
    .template-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }

    .footer-content {
        flex-direction: column;
        gap: 24px;
    }

    .footer-links {
        flex-direction: column;
        gap: 12px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .trust-badges {
        flex-direction: column;
        align-items: center;
    }

    .form-section {
        padding: 32px 16px 64px;
    }

    .wizard-progress {
        padding: 24px 16px 0;
    }

    .split-layout { flex-direction: column; }
    .split-preview { display: none; width: 100%; position: static; height: auto; border-left: none; border-top: 1px solid var(--color-border); }
    .split-preview.mobile-open { display: flex; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--color-bg-subtle); }
    .mobile-preview-toggle { display: flex; }
}
