/* =========================================
   HOOGIN | MARKET INTELLIGENCE
   ========================================= */

:root {
    --gold: #D4AF37;
    --gold-dark: #BD9139;
    --gold-light: #E6B944;
    --ink: #111827;
    --muted: #64748b;
    --border: #d5dbe5;
    --success: #166534;
    --error: #b91c1c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system,
                 BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);

    background-color: #101010;
    background-image: url("/static/hoogin-mountains.jpg");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* =========================================
   PAGE LAYOUT
   ========================================= */

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 36px 24px 72px;
}

/* =========================================
   HERO / BRANDING
   ========================================= */

.hero {
    width: min(100%, 960px);
    margin-bottom: 32px;
    color: #fff;
}

.hero-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.brand-copy {
    flex: 1;
    min-width: 0;
}

.brand-copy h1 {
    margin: 0;
    font-size: clamp(3.5rem, 7vw, 5.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.brand-subtitle {
    margin: 10px 0 14px;
    color: var(--gold);
    font-size: clamp(0.95rem, 2vw, 1.3rem);
    font-weight: 650;
    letter-spacing: 0.14em;
}

.hero-description {
    max-width: 440px;
    margin: 0;
    color: #e5e7eb;
    font-size: 1.05rem;
    line-height: 1.6;
}

.hero-logo {
    display: block;
    width: 260px;
    max-width: 35%;
    height: auto;
    object-fit: contain;
}

/* =========================================
   SIGNUP CARD
   ========================================= */

.card {
    width: min(560px, 100%);
    padding: 36px 40px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.card h2 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 1.8rem;
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.2;
    text-align: center;
}

.card > p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

/* =========================================
   FORM
   ========================================= */

.card form {
    display: grid;
    gap: 0;
}

.card form label {
    display: block;
    margin: 16px 0 8px;
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.card form input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.94rem;
    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.card form input::placeholder {
    color: #94a3b8;
}

.card form input:focus {
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
}

/* =========================================
   STOCK SEARCH
   ========================================= */

.stock-picker {
    width: 100%;
    min-width: 0;
}

.stock-search-wrapper {
    position: relative;
}

#stock-search {
    width: 100%;
}

#stock-search:focus {
    border-color: var(--gold-dark);
}

/* Dropdown */

.stock-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 1000;

    max-height: 230px;
    overflow-y: auto;

    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

/* The search script sets [hidden] when no results are showing. */

.stock-options[hidden] {
    display: none;
}

.stock-option {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;

    border: 0;
    border-bottom: 1px solid #eef0f4;
    border-radius: 0;
    background: #fff;

    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.stock-option:last-child {
    border-bottom: 0;
}

.stock-option strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.9rem;
    font-weight: 750;
}

.stock-option span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.stock-option:hover,
.stock-option:focus-visible {
    background: #f1f5f9;
    outline: none;
}

/* =========================================
   SELECTED STOCKS
   ========================================= */

.selected-stocks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.selected-stocks:empty {
    display: none;
}

.stock-message {
    margin: 10px 0 0;
    color: var(--error);
    font-size: 0.85rem;
}

.selected-stock {
    margin: 0;
    padding: 8px 12px;

    border: 0;
    border-radius: 6px;
    background: var(--ink);

    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 650;

    cursor: pointer;
    transition: background 0.2s ease;
}

.selected-stock:hover,
.selected-stock:focus-visible {
    background: #374151;
}

.selected-stock:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* =========================================
   SUBMIT BUTTON
   ========================================= */

.card form > button[type="submit"],
.button-link {
    width: 100%;
    min-height: 48px;
    margin-top: 24px;
    padding: 14px 20px;

    border: 0;
    border-radius: 7px;
    background: linear-gradient(
        100deg,
        var(--gold-dark),
        var(--gold-light)
    );

    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 750;

    cursor: pointer;

    transition:
        filter 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.card form > button[type="submit"]:hover,
.button-link:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(189, 145, 57, 0.25);
}

.card form > button[type="submit"]:active,
.button-link:active {
    transform: translateY(0);
}

.card form > button[type="submit"]:focus-visible,
.button-link:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

/* =========================================
   SUCCESS MESSAGE
   ========================================= */

.success-message {
    margin-top: 20px;
    padding: 16px 20px;

    border: 1px solid #15803d;
    border-radius: 8px;
    background: var(--success);

    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

/* =========================================
   ABOUT PAGE
   ========================================= */

.about h2 {
    margin-bottom: 24px;
}

.about h3 {
    margin: 24px 0 8px;
    color: var(--gold-dark);
    font-size: 0.85rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card.about > p {
    margin: 0;
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.65;
    text-align: left;
}

/* Same look as the signup button (see FORM); these undo link defaults. */
.button-link {
    display: block;
    text-align: center;
    text-decoration: none;
}

/* =========================================
   SITE NAV
   ========================================= */

.site-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    width: min(560px, 100%);
    margin-bottom: 20px;
}

.site-nav a {
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.55);

    color: #e5e7eb;
    font-size: 0.9rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-decoration: none;

    transition:
        border-color 0.2s ease,
        color 0.2s ease;
}

.site-nav a:hover {
    border-color: var(--gold);
    color: var(--gold-light);
}

.site-nav a[aria-current="page"] {
    border-color: var(--gold);
    background: linear-gradient(
        100deg,
        var(--gold-dark),
        var(--gold-light)
    );
    color: var(--ink);
}

.site-nav a:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

/* =========================================
   RESPONSIVE LAYOUT
   ========================================= */

@media (max-width: 768px) {
    .hero {
        width: min(100%, 650px);
    }

    .hero-brand {
        gap: 24px;
    }

    .hero-logo {
        width: 180px;
        max-width: 32%;
    }

    .hero-description {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    body {
        background-attachment: scroll;
        background-position: center center;
    }

    .container {
        padding: 24px 16px 48px;
    }

    .hero {
        margin-bottom: 24px;
    }

    .hero-brand {
        gap: 12px;
    }

    .brand-copy h1 {
        font-size: clamp(2.6rem, 11vw, 4rem);
    }

    .brand-subtitle {
        margin: 8px 0 10px;
        font-size: 0.8rem;
        letter-spacing: 0.1em;
    }

    .hero-description {
        font-size: 0.85rem;
        line-height: 1.45;
    }

    .hero-logo {
        width: 110px;
        max-width: 30%;
    }

    .card {
        padding: 26px 22px;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    .card > p {
        font-size: 0.88rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}