/* ============================================================
   ProForma Suite — Design System
   Apple-inspired light theme with neomorphic card depth
   ============================================================ */

/* --- Tokens --- */
:root {
    --bg:          #F5F5F7;
    --surface:     #FFFFFF;
    --surface-2:   #FAFAFA;
    --border:      #D2D2D7;
    --text-primary:   #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary:  #AEAEB2;
    --accent:      #0066CC;
    --accent-hover:#004499;
    --accent-light:#E8F0FB;
    --success:     #34C759;
    --danger:      #FF3B30;
    --neo-light:   rgba(255,255,255,0.9);
    --neo-shadow:  rgba(174,174,178,0.45);
    --radius-sm:   8px;
    --radius-md:   14px;
    --radius-lg:   20px;
    --nav-h:       64px;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    padding-top: var(--nav-h);
    -webkit-font-smoothing: antialiased;
}

/* --- Neomorphic mixin (applied via class) --- */
.neo {
    background: var(--surface);
    box-shadow:
        6px 6px 16px var(--neo-shadow),
        -4px -4px 12px var(--neo-light);
    border: 1px solid rgba(255,255,255,0.6);
}

.neo-inset {
    background: var(--bg);
    box-shadow:
        inset 3px 3px 8px var(--neo-shadow),
        inset -2px -2px 6px var(--neo-light);
    border: 1px solid var(--border);
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: var(--nav-h);
    background: rgba(245,245,247,0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    z-index: 1000;
}

.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    text-decoration: none;
}

.logo span {
    color: var(--accent);
    font-weight: 400;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

.nav-links a:hover { color: var(--accent); }

/* --- Hero --- */
.hero {
    max-width: 820px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
    text-align: center;
}

.hero-eyebrow {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.9rem;
    border-radius: 100px;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 1.25rem;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 2.5rem;
}

/* --- Buttons --- */
.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.15s, transform 0.15s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--accent);
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    border: 1.5px solid var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

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

/* --- Section layout --- */
.section {
    max-width: 1080px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-sm {
    max-width: 680px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.section h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.section-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 3rem;
}

.divider {
    border: none;
    height: 1px;
    background: var(--border);
    max-width: 1080px;
    margin: 0 auto;
}

/* --- App Grid --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* --- App Card (neomorphic) --- */
.app-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    box-shadow:
        8px 8px 20px var(--neo-shadow),
        -4px -4px 12px var(--neo-light);
    border: 1px solid rgba(255,255,255,0.7);
    transition: transform 0.2s, box-shadow 0.2s;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow:
        12px 16px 28px var(--neo-shadow),
        -4px -4px 14px var(--neo-light);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.app-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-light), #c8dff8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.version-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg);
    padding: 3px 8px;
    border-radius: 100px;
    border: 1px solid var(--border);
    font-family: "SF Mono", "Fira Mono", monospace;
}

.app-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    letter-spacing: -0.2px;
}

.app-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.card-actions {
    display: flex;
    gap: 0.6rem;
}

.btn-card-info {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s;
}

.btn-card-info:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-card-buy {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    transition: background 0.15s;
}

.btn-card-buy:hover { background: var(--accent-hover); }

/* --- How it works steps --- */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.step {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow:
        6px 6px 16px var(--neo-shadow),
        -3px -3px 10px var(--neo-light);
    border: 1px solid rgba(255,255,255,0.7);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.step h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.step p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* --- App Detail page --- */
.detail-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.detail-icon {
    width: 110px;
    height: 110px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--accent-light), #c8dff8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
    box-shadow:
        6px 6px 16px var(--neo-shadow),
        -3px -3px 10px var(--neo-light);
}

.detail-meta h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.detail-meta .tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    max-width: 480px;
}

.tag-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 100px;
}

.detail-cta { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }

.already-purchased {
    font-size: 0.88rem;
    color: var(--accent);
    text-decoration: none;
}
.already-purchased:hover { text-decoration: underline; }

/* --- Feature list --- */
.feature-list {
    list-style: none;
    margin-top: 1.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow:
        6px 6px 16px var(--neo-shadow),
        -3px -3px 10px var(--neo-light);
}

.feature-list li {
    background: var(--surface);
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.feature-list li:last-child { border-bottom: none; }

.feature-list li::before {
    content: "✓";
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* --- FAQ --- */
.faq-list { display: flex; flex-direction: column; gap: 1px; margin-top: 1.5rem; }

.faq-item {
    background: var(--surface);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.faq-item:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.faq-item:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); border-bottom: none; }

.faq-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-item a { color: var(--accent); text-decoration: none; }
.faq-item a:hover { text-decoration: underline; }

/* --- Contact box --- */
.contact-box {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow:
        6px 6px 16px var(--neo-shadow),
        -3px -3px 10px var(--neo-light);
    border-left: 3px solid var(--accent);
}

.contact-box p { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.contact-box p:last-child { margin-bottom: 0; }
.contact-box strong { color: var(--text-primary); }
.contact-box a { color: var(--accent); text-decoration: none; }

/* --- Downloads page --- */
.license-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow:
        8px 8px 20px var(--neo-shadow),
        -4px -4px 12px var(--neo-light);
    border: 1px solid rgba(255,255,255,0.7);
}

.license-box p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1rem; }

.license-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

.license-input {
    flex-grow: 1;
    min-width: 220px;
    background: var(--bg);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-family: "SF Mono", "Fira Mono", monospace;
    letter-spacing: 1px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: inset 2px 2px 6px var(--neo-shadow), inset -1px -1px 4px var(--neo-light);
}

.license-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: inset 2px 2px 6px var(--neo-shadow), 0 0 0 3px rgba(0,102,204,0.12);
}

.btn-validate {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-validate:hover { background: var(--accent-hover); }
.btn-validate:disabled { opacity: 0.5; cursor: not-allowed; }

#licenseResult { margin-top: 0.75rem; font-size: 0.9rem; font-weight: 500; }
.result-valid { color: var(--success); }
.result-invalid { color: var(--danger); }

.lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--bg);
    color: var(--text-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    cursor: default;
}

.download-link { display: none; }

.btn-download-active {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    transition: background 0.15s;
}

.btn-download-active:hover { background: var(--accent-hover); }

/* --- Footer --- */
.footer {
    max-width: 1080px;
    margin: 4rem auto 2rem;
    padding: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--text-tertiary);
}

.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-tertiary); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .navbar { padding: 0 5%; }
    .hero { padding: 4rem 1.5rem 3rem; }
    .detail-header { flex-direction: column; }
    .footer { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}
