/* ===========================================================
   EMMTECH — style.css
   Modern, minimal, premium startup-campaign styling.
=========================================================== */

:root {
    --emm-green: #0e9f6e;
    --emm-green-dark: #0b8058;
    --emm-green-light: #e6f7f0;
    --emm-text: #14181b;
    --emm-text-muted: #5b6570;
    --emm-bg: #ffffff;
    --emm-bg-alt: #f6f9f8;
    --emm-border: #e6eaec;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(15, 30, 25, 0.08);
    --max-width: 720px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--emm-text);
    background: var(--emm-bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 12px; }

/* ---------------- HERO ---------------- */
.hero {
    padding: 56px 0 40px;
    text-align: center;
    background: linear-gradient(180deg, var(--emm-green-light) 0%, #ffffff 70%);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 700;
    color: var(--emm-green-dark);
    margin: 0 0 14px;
}

.hero-title {
    font-size: clamp(2.1rem, 8vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-sub {
    font-size: clamp(1.05rem, 4vw, 1.3rem);
    font-weight: 600;
    color: var(--emm-green-dark);
    margin: 0 0 18px;
}

.hero-copy {
    max-width: 540px;
    margin: 0 auto 26px;
    color: var(--emm-text-muted);
    font-size: 1rem;
}

.hero-microcopy {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--emm-text-muted);
}

/* ---------------- BUTTONS ---------------- */
.btn {
    display: inline-block;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn-primary {
    background: var(--emm-green);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(14, 159, 110, 0.35);
}

.btn-primary:hover { background: var(--emm-green-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-hero {
    font-size: 1.05rem;
    padding: 18px 34px;
    width: 100%;
    max-width: 380px;
}

.btn-share {
    background: var(--emm-text);
    color: #fff;
    padding: 14px 28px;
    font-size: 0.95rem;
    width: 100%;
    max-width: 320px;
    margin-top: 8px;
}

/* ---------------- PROGRESS ---------------- */
.progress-section {
    padding: 34px 0;
    border-top: 1px solid var(--emm-border);
    border-bottom: 1px solid var(--emm-border);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.stat { flex: 1; }

.stat-value {
    display: block;
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    font-weight: 800;
    color: var(--emm-green-dark);
}

.stat-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--emm-text-muted);
    margin-top: 2px;
}

.progress-bar-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: var(--emm-bg-alt);
    overflow: hidden;
    border: 1px solid var(--emm-border);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emm-green) 0%, var(--emm-green-dark) 100%);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--emm-text-muted);
    margin-top: 10px;
}

/* ---------------- SECTIONS ---------------- */
.section { padding: 46px 0; }
.alt-bg { background: var(--emm-bg-alt); }

.section h2 {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.section-lead { color: var(--emm-text-muted); margin-bottom: 20px; }
.section-note { color: var(--emm-text-muted); font-size: 0.88rem; margin-top: 16px; }

/* Why $1 math grid */
.math-grid {
    background: #fff;
    border: 1px solid var(--emm-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.math-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--emm-border);
    font-size: 0.95rem;
}

.math-row:last-child { border-bottom: none; }
.math-row span:nth-child(2) { text-align: center; color: var(--emm-text-muted); }
.math-row span:nth-child(3) { text-align: right; font-weight: 700; }

.math-highlight {
    background: var(--emm-green-light);
}
.math-highlight span:nth-child(3) { color: var(--emm-green-dark); }

/* Funds use grid */
.use-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.use-grid li {
    background: #fff;
    border: 1px solid var(--emm-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* FAQ */
.faq-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--emm-border);
}
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 1rem; margin-bottom: 6px; }
.faq-item p { margin: 0; color: var(--emm-text-muted); font-size: 0.92rem; }

/* Final CTA */
.final-cta {
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, var(--emm-green-light) 100%);
}
.cta-copy {
    color: var(--emm-text-muted);
    margin-bottom: 24px;
    font-size: 1rem;
}
.cta-copy strong { color: var(--emm-text); }

/* Footer */
.footer {
    padding: 28px 0 40px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--emm-text-muted);
}
.footer-note { margin-top: 4px; }

/* ---------------- PAY OVERLAY ---------------- */
.pay-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 27, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}
.pay-overlay.hidden { display: none; }

.pay-overlay-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 30px 34px;
    text-align: center;
    box-shadow: var(--shadow);
}

.spinner {
    width: 34px;
    height: 34px;
    border: 4px solid var(--emm-border);
    border-top-color: var(--emm-green);
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: spin 0.8s linear infinite;
}

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

/* ---------------- SUCCESS PAGE ---------------- */
.success-page {
    background: var(--emm-bg-alt);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.success-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 420px;
    width: 100%;
    padding: 40px 28px;
    text-align: center;
}

.success-icon { font-size: 2.4rem; margin-bottom: 8px; }
.success-card h1 { font-size: 1.6rem; font-weight: 800; }
.success-sub { color: var(--emm-text-muted); margin-bottom: 22px; }

.success-details {
    background: var(--emm-bg-alt);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 22px;
    text-align: left;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.92rem;
}

.success-progress { margin-bottom: 20px; }
.success-progress p { font-size: 0.85rem; color: var(--emm-text-muted); margin-bottom: 8px; }

.share-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}
.share-options.hidden { display: none; }
.share-options a {
    flex: 1 1 auto;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--emm-bg-alt);
    border: 1px solid var(--emm-border);
    color: var(--emm-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.back-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--emm-text-muted);
    text-decoration: none;
    font-size: 0.88rem;
}

/* ---------------- ADMIN ---------------- */
.admin-body {
    background: var(--emm-bg-alt);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--emm-text);
    margin: 0;
}

.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 34px 30px;
    width: 100%;
    max-width: 360px;
}

.admin-card h1 { font-size: 1.3rem; margin-bottom: 20px; }

.admin-card label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin: 14px 0 6px;
}

.admin-card input[type="text"],
.admin-card input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--emm-border);
    border-radius: 8px;
    font-size: 0.95rem;
}

.admin-error {
    background: #fdeceb;
    color: #b3261e;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.admin-top {
    background: #fff;
    border-bottom: 1px solid var(--emm-border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-top h1 { font-size: 1.1rem; margin: 0; }
.admin-top a { color: var(--emm-text-muted); text-decoration: none; font-size: 0.85rem; }

.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 24px; }

.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}
.admin-metric {
    background: #fff;
    border: 1px solid var(--emm-border);
    border-radius: 12px;
    padding: 16px 18px;
}
.admin-metric span { display: block; }
.admin-metric .m-value { font-size: 1.4rem; font-weight: 800; color: var(--emm-green-dark); }
.admin-metric .m-label { font-size: 0.75rem; color: var(--emm-text-muted); margin-top: 4px; }

.admin-table-wrap {
    background: #fff;
    border: 1px solid var(--emm-border);
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 30px;
}
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.admin-table th, table.admin-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--emm-border);
    white-space: nowrap;
}
table.admin-table th { background: var(--emm-bg-alt); font-weight: 700; }
table.admin-table tr:last-child td { border-bottom: none; }

.badge { padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.badge-successful { background: var(--emm-green-light); color: var(--emm-green-dark); }
.badge-pending { background: #fff6db; color: #8a6d00; }
.badge-failed, .badge-abandoned { background: #fdeceb; color: #b3261e; }

/* ---------------- RESPONSIVE ---------------- */
@media (min-width: 640px) {
    .use-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 380px) {
    .container { padding: 0 16px; }
    .use-grid { grid-template-columns: 1fr; }
}
