/* ===== DNAGedcom Static Site ===== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue:       #4A90E2;
    --blue-dark:  #2e3092;
    --blue-light: #e3f2fd;
    --green:      #7DB655;
    --green-dark: #5a9a35;
    --green-light:#e8f5e9;
    --teal:       #009688;
    --teal-light: #e0f2f1;
    --gray-50:    #fafafa;
    --gray-100:   #f5f5f5;
    --gray-200:   #eeeeee;
    --gray-300:   #e0e0e0;
    --gray-400:   #bdbdbd;
    --gray-600:   #757575;
    --gray-800:   #424242;
    --gray-900:   #212121;
    --danger:     #e74c3c;
    --white:      #ffffff;
    --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius:     6px;
    --shadow:     0 2px 12px rgba(0,0,0,.08);
    --shadow-lg:  0 4px 24px rgba(0,0,0,.12);
    --max-width:  960px;
    --nav-height: 64px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
}

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

img { max-width: 100%; height: auto; }

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

/* --- Top Nav --- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 3px solid var(--blue-dark);
    box-shadow: var(--shadow);
    height: var(--nav-height);
}

.site-nav .container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 32px;
}

.site-nav .logo img {
    height: 44px;
    width: auto;
}

.site-nav .nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    margin-left: auto;
}

.site-nav .nav-links a {
    display: block;
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--gray-800);
    font-size: 15px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.site-nav .nav-links a:hover,
.site-nav .nav-links a.active {
    background: var(--blue-light);
    color: var(--blue-dark);
    text-decoration: none;
}

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

.site-nav .nav-auth .user-greeting {
    font-size: 14px;
    color: var(--gray-600);
}

/* Mobile menu toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--gray-800); margin: 5px 0; transition: .2s; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); }

.btn-secondary { background: var(--blue); color: var(--white); }
.btn-secondary:hover { background: var(--blue-dark); }

.btn-outline { background: transparent; border: 2px solid var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--white); }

.btn-small { padding: 6px 16px; font-size: 13px; }
.btn-full { width: 100%; }

/* --- Hero --- */
.hero {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, var(--teal) 100%);
    color: var(--white);
    padding: 64px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.15rem;
    opacity: .9;
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero .btn { margin: 0 8px; }

/* --- Accent stripe (matches MacClient header) --- */
.accent-stripe {
    height: 4px;
    background: linear-gradient(90deg, var(--blue-dark), var(--green), var(--teal));
}

/* --- Cards --- */
.card {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card h3 {
    color: var(--blue-dark);
    margin-bottom: 12px;
    font-size: 1.15rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

/* --- Section --- */
.section {
    padding: 48px 0;
}

.section h2 {
    font-size: 1.6rem;
    color: var(--gray-900);
    margin-bottom: 24px;
}

.section-alt { background: var(--gray-100); }

/* --- FAQ Accordion --- */
.faq-item {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: var(--white);
    border: none;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray-800);
    transition: background .15s;
}

.faq-question:hover { background: var(--gray-100); }

.faq-question .arrow {
    transition: transform .2s;
    font-size: 12px;
    color: var(--gray-600);
}

.faq-question[aria-expanded="true"] .arrow { transform: rotate(180deg); }

.faq-answer {
    padding: 0 20px 16px;
    color: var(--gray-600);
    line-height: 1.7;
}

/* --- Login Page --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, var(--teal) 100%);
}

.login-container {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container .logo-img { height: 48px; margin-bottom: 16px; }

.login-container h1 {
    font-size: 1.4rem;
    color: var(--gray-900);
    margin-bottom: 24px;
}

.field {
    margin-bottom: 16px;
    text-align: left;
}

.field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font);
    transition: border-color .15s;
}

.field input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, .15);
}

.error-text { color: var(--danger); font-size: 14px; margin-top: 12px; }
.success-text { color: var(--green); font-size: 14px; margin-top: 12px; }

/* --- Footer --- */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 32px 20px;
    font-size: 14px;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.site-footer a { color: var(--gray-300); }
.site-footer a:hover { color: var(--white); }

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

/* --- Prose (for privacy, terms, etc.) --- */
.prose h1 { font-size: 1.8rem; margin-bottom: 16px; color: var(--gray-900); }
.prose h2 { font-size: 1.3rem; margin: 32px 0 12px; color: var(--gray-900); }
.prose h3 { font-size: 1.1rem; margin: 24px 0 8px; color: var(--gray-800); }
.prose p  { margin-bottom: 16px; color: var(--gray-600); }
.prose ul, .prose ol { margin: 0 0 16px 24px; color: var(--gray-600); }
.prose li { margin-bottom: 8px; }

/* --- User level badges --- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-admin  { background: #7B1FA2; color: white; }
.badge-angel  { background: #e74c3c; color: white; }
.badge-gold   { background: #F57C00; color: white; }
.badge-silver { background: var(--blue); color: white; }
.badge-user   { background: var(--gray-400); color: white; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .site-nav .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 12px 20px;
        border-bottom: 1px solid var(--gray-300);
        box-shadow: var(--shadow);
    }

    .site-nav .nav-links.open { display: flex; }

    .hero h1 { font-size: 1.8rem; }
    .hero { padding: 40px 20px; }

    .site-footer .container { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
}
