@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@600;700;800;900&display=swap');

/* IFP Design System — Premium Landing Theme */
:root {
    --bg: #f9fafb;
    --panel: #ffffff;
    --muted: #6b7280;
    --text: #111827;
    --line: #e5e7eb;
    /* More marked for better definition */
    --line-active: #d1d5db;
    --brand: #111827;

    /* Premium Shadows — Soft & Diffuse */
    --shadow-base: 0 1px 3px rgba(17, 24, 39, .07);
    --shadow-md: 0 6px 16px rgba(17, 24, 39, .06);
    --shadow-lg: 0 10px 40px rgba(17, 24, 39, .1);

    --radius: 16px;
    --radius-sm: 12px;
    --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 0;
}

.container {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
}

/* Header — Glassmorphism & Pro */
.landing-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
    padding: 16px 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
}

.logo i {
    font-size: 1.5rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    color: var(--muted);
    font-size: 15.5px;
    font-weight: 600;
    padding: 8px 12px;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-login {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-base);
}

.btn-login:hover {
    border-color: var(--line-active);
    box-shadow: var(--shadow-md);
}

/* Buttons — Gelato Style */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 16px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
    box-shadow: var(--shadow-base);
}

.btn-secondary:hover {
    border-color: var(--line-active);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 12px 24px;
    font-size: 16.5px;
}

/* Hero — Balanced */
.hero {
    padding: 100px 0 60px;
    background: #fff;
    overflow: hidden;
}

.hero-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 48px;
}

.hero-title {
    font-size: 42px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-title .gradient-text {
    color: #111827;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--muted);
    margin-bottom: 32px;
    max-width: 520px;
    line-height: 1.5;
}

.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 14px;
}

.hero-cta-note {
    margin: 0 0 34px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
}

.hero-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 24px;
    font-weight: 900;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-image {
    width: 100%;
    max-width: 1000px;
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f3f4f6;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-image img {
    width: 100%;
    display: block;
}

/* Sections — Compact */
.benefits,
.demo,
.how-it-works,
.testimonials,
.final-cta {
    padding: 100px 0;
}

.final-cta {
    text-align: center;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.benefits {
    background: var(--bg);
}

.section-title {
    font-size: 28px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 48px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.benefit-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-base);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition);
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.benefit-icon {
    font-size: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 12px;
    border: 1px solid var(--line);
    margin-bottom: 8px;
}

.benefit-card h3 {
    font-size: 18px;
    font-weight: 900;
}

.benefit-card p {
    font-size: 15.5px;
    color: var(--muted);
    margin: 0;
}

/* Steps — How it works */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    text-align: center;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--brand);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    margin: 0 auto 16px;
}

.step h3 {
    font-size: 17px;
    margin-bottom: 8px;
    font-weight: 800;
}

.step p {
    font-size: 15px;
    color: var(--muted);
}

.step-icon {
    margin-top: 12px;
    font-size: 18px;
    color: var(--muted);
}

/* Demo Section — Premium Analysis Zone */
.demo-box {
    max-width: 900px;
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 48px;
    box-shadow: var(--shadow-lg);
}

.demo-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 16px;
    margin-bottom: 32px;
}

.upload-area {
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    padding: 80px 32px;
    background: #fbfbfc;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--brand);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.upload-area i {
    font-size: 40px;
    margin-bottom: 20px;
    display: block;
    color: var(--brand);
}

.upload-area p {
    font-size: 17px;
    color: var(--muted);
    margin: 0;
}

.upload-area .browse {
    font-weight: 700;
    color: var(--brand);
    border-bottom: 2px solid rgba(17, 24, 39, 0.1);
}

/* Result Section */
.demo-result {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line2);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-header h3 {
    font-size: 17px;
}

.btn-reset {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.result-score {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.score-circle {
    width: 52px;
    height: 52px;
    background: var(--brand);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
}

.score-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.score-desc {
    font-size: 15px;
    font-weight: 800;
}

.result-top {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    margin-bottom: 24px;
    align-items: center;
}

.image-preview-container {
    width: 200px;
    height: 200px;
    background: #f3f4f6;
    border-radius: 12px;
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.preview-loading {
    font-size: 24px;
    color: var(--muted);
}

@media (max-width: 600px) {
    .result-top {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
}

/* Rich Analysis Result Styling */
.analysis-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

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

.param-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-label {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
}

.param-bar {
    height: 8px;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
}

.param-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 10px;
}

.desc-box {
    background: #fbfbfc;
    border-left: 4px solid var(--brand);
    padding: 20px;
    border-radius: 0 10px 10px 0;
    margin-bottom: 24px;
}

.desc-box h4 {
    font-size: 17px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.desc-box p {
    font-size: 17px;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

.rec-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rec-item {
    display: flex;
    gap: 12px;
    font-size: 17px;
    color: var(--text);
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    align-items: center;
}

.rec-item i {
    color: #10b981;
}

/* Testimonials — Clean */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.testimonial {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-base);
    transition: var(--transition);
}

.testimonial:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.testimonial p {
    font-size: 15.5px;
    font-style: italic;
    margin: 12px 0;
}

.author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line);
}

.author strong {
    display: block;
    font-size: 15px;
}

.author span {
    font-size: 13px;
    color: var(--muted);
}

/* Responsive */
@media (max-width: 980px) {
    .hero-grid {
        text-align: center;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        margin: 0 auto 32px;
    }
}

@media (max-width: 768px) {

    .benefits-grid,
    .steps,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 24px;
    }

    .header-nav {
        display: none;
    }
}

/* Modal — Perfectly Centered & Premium */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    /* Centered via display: flex in JS */
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.modal-content {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
    position: relative;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 24px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text);
    transform: rotate(90deg);
}

.modal-content h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 24px;
    font-family: 'Outfit', sans-serif;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-content input {
    padding: 14px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.modal-content input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.04);
}

.modal-content p {
    text-align: center;
    margin-top: 24px;
    color: var(--muted);
    font-size: 16px;
}

.modal-content p a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 768px) {
    .modal {
        padding: 16px;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        padding: 32px 24px 24px;
        border-radius: 18px;
        box-sizing: border-box;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }

    .close-modal {
        top: 16px;
        right: 16px;
        font-size: 22px;
    }

    .modal-content h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .modal-content form {
        gap: 14px;
    }

    .modal-content input {
        width: 100%;
        box-sizing: border-box;
        font-size: 16px;
    }

    .modal-content form button,
    .modal-content .btn-primary,
    .modal-content .btn-login,
    .modal-content .btn-logout {
        width: 100%;
        box-sizing: border-box;
        justify-content: center;
    }

    .modal-content p {
        font-size: 15px;
        line-height: 1.5;
        margin-top: 18px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 12px;
    }

    .modal-content {
        padding: 28px 16px 18px;
        border-radius: 16px;
        max-height: calc(100vh - 24px);
    }

    .close-modal {
        top: 14px;
        right: 14px;
        font-size: 20px;
    }

    .modal-content h2 {
        font-size: 22px;
        margin-bottom: 18px;
    }

    .modal-content input {
        padding: 13px 14px;
        font-size: 16px;
    }

    .modal-content p {
        font-size: 14px;
        margin-top: 16px;
    }
}
