/* ═══════════════════════════════════════════════════════════════
   CloudStudent — Main Stylesheet
   ═══════════════════════════════════════════════════════════════ */

:root {
    --primary:      #6C3EFF;
    --primary-dark: #4E22E0;
    --primary-light:#EDE9FF;
    --accent:       #FF6B6B;
    --success:      #22C55E;
    --text:         #1A1A2E;
    --text-muted:   #64748B;
    --border:       #E2E8F0;
    --bg:           #F8F9FC;
    --white:        #FFFFFF;
    --radius:       14px;
    --radius-sm:    8px;
    --shadow:       0 4px 24px rgba(108,62,255,.10);
    --shadow-lg:    0 12px 48px rgba(108,62,255,.18);
    --transition:   .2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.hidden { display: none !important; }

/* ─── HEADER ──────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo i { color: var(--primary); font-size: 20px; }
.logo span { color: var(--primary); }
.logo-sm { font-size: 18px; }

.nav-links {
    display: flex;
    gap: 28px;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color var(--transition);
}
.nav-links a:hover { color: var(--primary); }

/* ─── HERO ────────────────────────────────────────────────────── */
.hero {
    padding: 80px 0 56px;
    text-align: center;
    background: linear-gradient(160deg, #F5F2FF 0%, #EEF2FF 50%, var(--bg) 100%);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    color: var(--text);
    margin-bottom: 16px;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 28px;
}

.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 100px;
}
.badge i { color: var(--primary); }

/* ─── FORM SECTION ────────────────────────────────────────────── */
.form-section {
    padding: 56px 0 80px;
}

.form-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 40px;
    max-width: 760px;
    margin: 0 auto;
}

.step-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

/* Type cards */
.type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 36px;
}

.type-card input[type="radio"] { display: none; }

.type-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}
.type-card-inner i {
    font-size: 28px;
    color: var(--primary);
}
.type-card-inner strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.type-card-inner span {
    font-size: 13px;
    color: var(--text-muted);
}

.type-card:hover .type-card-inner,
.type-card input:checked + .type-card-inner {
    border-color: var(--primary);
    background: var(--primary-light);
}

.type-card input:checked + .type-card-inner {
    box-shadow: 0 0 0 3px rgba(108,62,255,.2);
}

/* Field group */
.field-group {
    margin-bottom: 24px;
}
.field-group label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.field-hint {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

#topic-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition);
    background: var(--white);
}
#topic-input:focus { border-color: var(--primary); }
#topic-input::placeholder { color: #B0B8C9; }

/* Pages grid */
.pages-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pages-card { cursor: pointer; }
.pages-card input[type="radio"] { display: none; }
.pages-card span {
    display: block;
    padding: 9px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
    background: var(--white);
}
.pages-card:hover span,
.pages-card input:checked + span {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Buttons */
.btn-generate {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #9B59F7 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition);
    box-shadow: 0 6px 24px rgba(108,62,255,.35);
}
.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(108,62,255,.45);
}
.btn-generate:active { transform: translateY(0); }

.form-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ─── PROGRESS SECTION ────────────────────────────────────────── */
.progress-section { padding: 80px 0; }

.progress-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 48px 40px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.progress-spinner {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
}

.progress-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.progress-message {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
    text-align: left;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid transparent;
    transition: all var(--transition);
}
.progress-step i { color: var(--text-muted); width: 16px; }

.progress-step.active {
    color: var(--primary);
    background: var(--primary-light);
    border-color: var(--primary);
    font-weight: 600;
}
.progress-step.active i { color: var(--primary); }

.progress-step.done {
    color: var(--success);
    background: #F0FDF4;
    border-color: var(--success);
}
.progress-step.done i { color: var(--success); }

.progress-bar-wrap {
    background: var(--bg);
    border-radius: 100px;
    height: 6px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #9B59F7);
    border-radius: 100px;
    transition: width .5s ease;
}

/* ─── PREVIEW SECTION ─────────────────────────────────────────── */
.preview-section { padding: 56px 0 80px; }

.preview-header {
    text-align: center;
    margin-bottom: 36px;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}
.section-title.center { text-align: center; }

.section-sub {
    font-size: 16px;
    color: var(--text-muted);
}

/* Document preview */
.doc-wrapper {
    position: relative;
    max-width: 700px;
    margin: 0 auto 40px;
}

.doc-pages {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    max-height: 560px;
    overflow-y: hidden;
}

/* Generated preview pages */
.preview-doc { background: #fff; }

.preview-page {
    background: #fff;
    padding: 48px 56px;
    border-bottom: 2px dashed var(--border);
    font-family: 'Times New Roman', Times, serif;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.8;
}
.preview-page:last-child { border-bottom: none; }

.preview-page-2 { opacity: .7; }

.preview-h1 {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 24px;
    letter-spacing: .5px;
}

.preview-h2 {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    margin: 20px 0 14px;
}

.preview-h3 {
    font-size: 14px;
    font-weight: bold;
    margin: 12px 0 8px;
}

.preview-p {
    text-indent: 1.25em;
    margin-bottom: 6px;
}

.preview-blur {
    filter: blur(4px);
    user-select: none;
}

/* Blur overlay */
.doc-blur-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background: linear-gradient(to bottom, transparent 0%, rgba(248,249,252,.95) 60%, var(--bg) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 24px;
}

.unlock-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 24px;
    box-shadow: var(--shadow);
}
.unlock-prompt i { color: var(--primary); font-size: 20px; }
.unlock-prompt strong { font-size: 15px; font-weight: 700; }
.unlock-prompt span { font-size: 13px; color: var(--text-muted); }

/* Unlock card */
.unlock-card {
    max-width: 700px;
    margin: 0 auto 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.unlock-features {
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.unlock-feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.unlock-feature > i {
    font-size: 22px;
    color: var(--primary);
    width: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}
.unlock-feature strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.unlock-feature span {
    font-size: 14px;
    color: var(--text-muted);
}

.unlock-cta {
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.price-block {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-shrink: 0;
}
.price-old {
    font-size: 18px;
    color: var(--text-muted);
    text-decoration: line-through;
}
.price-new {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
}
.price-badge {
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.btn-buy {
    flex: 1;
    min-width: 220px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent), #ff4757);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition);
    box-shadow: 0 6px 20px rgba(255,107,107,.4);
}
.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(255,107,107,.5);
}
.btn-buy:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.payment-note {
    width: 100%;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: -12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Download card */
.download-card {
    max-width: 700px;
    margin: 0 auto 24px;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: var(--radius);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.download-success {
    display: flex;
    align-items: center;
    gap: 16px;
}
.download-success i { font-size: 28px; color: var(--success); }
.download-success strong { display: block; font-size: 16px; font-weight: 700; color: var(--text); }
.download-success span { font-size: 14px; color: var(--text-muted); }

.btn-download {
    padding: 14px 28px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
    flex-shrink: 0;
}
.btn-download:hover { background: #16A34A; transform: translateY(-1px); }

.new-work-row {
    text-align: center;
    margin-top: 16px;
}

.btn-secondary {
    padding: 11px 22px;
    background: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ─── HOW IT WORKS ────────────────────────────────────────────── */
.how-section {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg) 0%, #EEF2FF 100%);
}

.how-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.how-step {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
}

.how-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.how-step h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.how-step p  { font-size: 14px; color: var(--text-muted); }

/* ─── EXAMPLES ────────────────────────────────────────────────── */
.examples-section { padding: 72px 0 80px; }

.examples-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 32px;
}

.example-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}
.example-chip i { color: var(--primary); }
.example-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

/* ─── FOOTER ──────────────────────────────────────────────────── */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
}
.footer-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ─── TOAST ───────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    animation: toast-in .25s ease;
}
.toast.error { background: var(--accent); }
.toast.success { background: var(--success); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .nav-links { display: none; }
    .hero { padding: 48px 0 36px; }
    .hero-sub { font-size: 16px; }
    .form-card { padding: 24px 20px; }
    .type-grid { grid-template-columns: 1fr; }
    .unlock-cta { flex-direction: column; align-items: stretch; }
    .download-card { flex-direction: column; }
    .btn-download { justify-content: center; }
    .preview-page { padding: 28px 24px; }
    .unlock-features { padding: 20px; }
}
