/* --- Global Apple-esque Styles --- */
:root {
    --accent-color: #007aff; /* Apple Blue */
    --accent-color-dark: #005bb5; /* darker accent for better contrast */
    --text-color: #1d1d1f; /* Apple Black */
    --text-color-light: #333333; /* stronger mid-gray for readability */
    --bg-color: #f5f5f7; /* Apple Background */
    --card-bg: #ffffff;
    --border-color: #d2d2d7;
    --info-bg: #e6f2ff; /* Light Apple blue */
    --info-border: #cce4ff;
    --info-text-dark: #003d99; /* Darker blue for better contrast */
    --info-text-light: #003d99; /* Unified darker blue */
    --nav-bg: #ffffff; /* solid navigation background for reliable contrast */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* --- Navigation --- */
.main-nav {
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.nav-content {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.nav-logo-img {
    display: block;
    height: 34px;
    width: auto;
}

.nav-logo-text {
    display: inline-block;
    line-height: 1;
    color: var(--text-color);
    font-weight: 600;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.95rem;
    padding: 10px 0;
    transition: color 0.3s ease;
    font-weight: 500;
}

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

.nav-links a.active {
    color: var(--accent-color-dark);
    font-weight: 700;
}

.nav-toggle {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: transform 0.3s ease;
}


/* --- Hero Section (Homepage) --- */
.hero {
    text-align: center;
    padding: 100px 20px;
    background-color: var(--card-bg);
    border-radius: 18px;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 15px 0;
    line-height: 1.1;
}

.hero h2 {
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text-color-light);
    margin: 0 0 30px 0;
}

/* --- General Content Styling --- */
h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--text-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.2;
}

h1 { font-size: 2.8rem; letter-spacing: -0.2px; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.1rem; font-weight: 700; }

p, li {
    font-size: 1.1rem;
    color: var(--text-color);
}
p.subtle, li.subtle {
    color: var(--text-color-light);
}

ul, ol {
    padding-left: 25px;
}
li {
    margin-bottom: 10px;
}

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

/* --- Buttons --- */
.button-group {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px; /* Apple-style pill button */
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    line-height: 1.5; /* Ensures consistent height across <a> and <button> elements */
}

.button-primary {
    background-color: var(--accent-color);
    color: var(--card-bg);
}
.button-primary:hover {
    background-color: #0070e0;
    transform: translateY(-2px);
    text-decoration: none;
}

.button-secondary {
    background-color: #e5e5ea;
    color: var(--text-color);
}
.button-secondary:hover {
    background-color: #dcdce0;
    transform: translateY(-2px);
    text-decoration: none;
}
.button-secondary[disabled] {
    background-color: #f0f0f0;
    color: #555555;
    cursor: not-allowed;
    transform: none;
}
.button-secondary[disabled]:hover {
    background-color: #f0f0f0;
}

/* --- Content Sections / Cards --- */
.content-section {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 18px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.content-section h1:first-child,
.content-section h2:first-child {
    margin-top: 0;
}

/* --- Grid Layouts --- */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

.grid-card {
    background-color: var(--bg-color);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    display: block;
}

.grid-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
}
.grid-card p {
    font-size: 1rem;
    color: var(--text-color-light);
    margin: 0;
}

/* Info Box */
.info-box {
    background-color: var(--info-bg);
    border: 1px solid var(--info-border);
    padding: 25px;
    border-radius: 12px;
}
.info-box h4 {
    margin-top: 0;
    color: var(--info-text-dark);
}
.info-box p {
    color: var(--info-text-light);
    margin-bottom: 0;
}

/* Illustration Placeholder */
.illustration-placeholder {
    width: 100%;
    aspect-ratio: 1797 / 850;
    background-color: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
    overflow: hidden;
}

.illustration-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ensure the hero illustration fits without cropping its sides */
.hero .illustration-placeholder img {
    object-fit: contain;
    background-color: var(--bg-color);
}

/* Make the hero image holder shorter so the full width of wide images is visible */
.hero .illustration-placeholder {
    /* match source aspect ratio (4096x1668) to avoid unexpected cropping */
    aspect-ratio: 4096 / 1668;
    max-height: 340px;
    overflow: hidden;
}

@media (max-width: 900px) {
    .hero .illustration-placeholder { max-height: 260px; }
}

@media (max-width: 600px) {
    .hero .illustration-placeholder { max-height: 160px; }
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: #555555;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-nav {
    list-style: none;
    padding: 0;
    margin: 10px 0 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}
.footer-nav a:hover {
    color: var(--accent-color);
}

/* --- Responsive Tweaks --- */
img, svg, picture {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Optimize image loading and rendering */
img {
    content-visibility: auto;
}

.nav-logo-img {
    display: block;
    height: 34px;
    width: auto;
    font-display: swap;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        z-index: 1001;
        padding: 12px;
    }
    .nav-content {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
        padding: 16px 20px;
        background: linear-gradient(135deg, var(--card-bg) 0%, #fafbfc 100%);
        border-top: 1px solid var(--border-color);
        position: relative;
        z-index: 1000;
    }
    .nav-links li {
        margin: 10px 0;
    }
    .main-nav.nav-open .nav-links {
        display: flex;
    }
    .main-nav.nav-open .nav-toggle span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .main-nav.nav-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }
    .main-nav.nav-open .nav-toggle span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .container {
        padding: 30px 16px;
    }
    .hero h1 { font-size: 2.4rem; }
    .hero h2 { font-size: 1.25rem; }
    .content-section { padding: 28px; }
    .grid-2-col, .grid-3-col { grid-template-columns: 1fr; }
}


/* --- Credit Card Packs (Apple Pay/Google Pay Inspired) --- */
.credit-packs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px 0;
}

/* --- Leadership Section --- */
.leadership-section { padding: 40px 80px !important; }
.leadership-section h2 {
    text-align: center;
}

.leadership-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 30px;
}

.leader {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.avatar {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 50%;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ensure avatar images are block-level and centered by default */
.avatar img { display: block; margin: 0 auto; }

.leader-content h3 {
    margin-top: 0;
    margin-bottom: 4px;
}

.role {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.leader-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color-light);
}

.credit-card {
    position: relative;
    background: linear-gradient(135deg, var(--card-bg) 0%, #fafbfc 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.credit-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--accent-color);
}

.credit-card.featured {
    border: 2px solid var(--accent-color);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.15);
}

.credit-card.featured:hover {
    box-shadow: 0 12px 32px rgba(0, 122, 255, 0.25);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-color), #005bc4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.card-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.credits-amount {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 4px;
}

.credits-label {
    font-size: 0.9rem;
    color: var(--text-color-light);
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credit-card .price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 8px 0 12px 0;
}

.credit-card .description {
    font-size: 0.95rem;
    color: var(--text-color-light);
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.card-button:hover {
    background-color: #0070e0;
    transform: scale(1.02);
    text-decoration: none;
}

.credit-packs-subtitle {
    text-align: center;
    margin-top: 40px;
    font-size: 0.9rem;
    color: var(--text-color-light);
}

/* small helper for simple redirects or center-only blocks */
.redirect-center { text-align: center; }

/* --- Legal / Tabs --- */
.legal-tabs .tab-list {
    display: flex;
    gap: 12px;
    margin: 18px 0 24px 0;
}
.legal-tabs .tab-button {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}
.legal-tabs .tab-button.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}
.tab-panel { display: none; }
.tab-panel h2 { margin-top: 0; }

.legal-links { margin-top: 10px; }
.legal-links a { color: var(--text-color); font-weight: 600; }

/* Legacy inline styles moved from legal.html */
.legal-container {
    max-width: 900px;
    margin: 40px auto;
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; flex-wrap: wrap; }
.tab-btn {
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #d0d0d5;
    color: var(--text-color);
    font-weight: 700;
    font-size: 0.95rem;
}
.tab-btn.active { background: var(--accent-color); color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content h2 { margin-top: 20px; }
.tab-content p, .tab-content li { margin-bottom: 10px; line-height: 1.6; }

/* --- Passkey Modal --- */
.modal { display: none; position: fixed; inset: 0; z-index: 2000; align-items: center; justify-content: center; }
.modal[aria-hidden="false"] { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.modal-dialog { position: relative; background: var(--card-bg); padding: 20px; border-radius: 12px; max-width: 420px; width: min(92%, 420px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 2; }
.modal-dialog input[type="password"] { width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; box-sizing: border-box; max-width: 100%; }
.modal-actions { display:flex; gap:12px; margin-top:12px; }
.passkey-error { color: #b00020; margin-top: 10px; display: none; }
.modal p.subtle { margin-top: 0; color: var(--text-color-light); }


@media (max-width: 900px) {
    .credit-packs {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .tabs { gap: 8px; }
    .tab-btn { 
        padding: 12px 14px; 
        font-size: 1rem; 
        flex: 1;
    }
    .leadership-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .container { padding: 20px 12px; }
    .hero { padding: 40px 16px; }
    .hero h1 { font-size: 2rem; }
    .hero h2 { font-size: 1.1rem; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    .button-group { flex-direction: column; align-items: stretch; }
    .button-group .button {
        text-align: center;
    }
    .content-section { padding: 20px; }
    .nav-logo { font-size: 1rem; }
    .nav-logo-img { height: 28px; }
    .nav-logo-text { font-size: 0.95rem; }
    .credit-packs { grid-template-columns: 1fr; gap: 12px; }
    .card-header { padding: 16px; }
    .card-body { padding: 16px; }
    .credits-amount { font-size: 2.2rem; }
    .credit-card .price { font-size: 1.4rem; }
    .tabs { gap: 8px; flex-direction: column; }
    .tab-btn { 
        padding: 14px 16px; 
        font-size: 1.1rem; 
        width: 100%; 
        text-align: left;
    }
    .leadership-section { padding: 20px 40px !important; }
    .leadership-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .leader {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .avatar {
        width: 80px;
        height: 80px;
    }
    /* Center grid items so single-column leaders are centered */
    .leadership-grid { justify-items: center; }
    /* Ensure avatar gets vertical spacing and stays centered */
    .avatar { margin: 0 auto 18px; }
}