/* CSS Variables - Warm Earthy Palette */
:root {
    /* Colors */
    --color-bg: #FAF8F5;
    --color-bg-white: #ffffff;
    --color-text-primary: #2D2A26;
    --color-text-secondary: #5C5651;
    --color-text-muted: #9A9590;
    --color-border: #E8E4DF;
    --color-border-focus: #7D6B4F;

    /* Warm earthy accent */
    --color-accent: #7D6B4F;
    --color-accent-hover: #5E5039;
    --color-accent-light: #F0EBE3;
    --color-accent-secondary: #6B8E5C;

    /* Blue accent (from logo lake) - used very sparingly */
    --color-lake: #7A9AAE;
    --color-lake-light: rgba(122, 154, 174, 0.08);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    --font-size-4xl: 36px;
    --font-size-5xl: 48px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(45, 42, 38, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(45, 42, 38, 0.1), 0 2px 4px -1px rgba(45, 42, 38, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(45, 42, 38, 0.1), 0 4px 6px -2px rgba(45, 42, 38, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(45, 42, 38, 0.1), 0 10px 10px -5px rgba(45, 42, 38, 0.04);

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Header */
.header {
    background: var(--color-bg-white);
    border-bottom: 1px solid var(--color-border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    color: var(--color-text-primary);
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin-right: -10px;
}

.logo-text {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.github-btn:hover {
    background: var(--color-bg-white);
    border-color: var(--color-text-muted);
    color: var(--color-text-primary);
}

.github-btn svg {
    width: 18px;
    height: 18px;
}

/* Hero Section */
.hero {
    min-height: calc(100vh - 73px);
    display: flex;
    align-items: center;
    padding: var(--space-12) 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    align-items: center;
    width: 100%;
}

.hero-content {
    max-width: 540px;
}

.hero-headline {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-6);
}

.accent-text {
    background: linear-gradient(135deg, #6B8E5C 0%, #7D6B4F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    line-height: 1.7;
    max-width: 480px;
    margin-bottom: var(--space-8);
}

/* Stats Section */
.hero-stats {
    display: flex;
    gap: var(--space-8);
}

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

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-accent);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* Search Form Card */
.form-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
}

.form-card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-6);
    color: var(--color-text-primary);
}

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    color: var(--color-text-primary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-border-focus);
    /* Layered focus ring: warm inner glow with subtle blue outer glow */
    box-shadow:
        0 0 0 3px var(--color-accent-light),
        0 0 0 5px rgba(122, 154, 174, 0.1);
    background: var(--color-bg-white);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.submit-btn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: var(--font-family);
    color: white;
    background: var(--color-accent-secondary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: var(--space-2);
}

.submit-btn:hover {
    background: #5A7A4A;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled,
.submit-btn:disabled:hover {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button loading state */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.spinner {
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

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

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: center;
    margin-top: var(--space-4);
}

/* Search Input with Icon */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .form-input {
    padding-left: var(--space-10);
}

.search-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    pointer-events: none;
}

/* Suggestions dropdown */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    margin-top: var(--space-1);
}

.suggestions:empty {
    display: none;
}

.suggestion {
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: background 0.15s ease;
}

.suggestion:hover {
    background: var(--color-accent-light);
}

.suggestion-name {
    font-weight: 500;
    color: var(--color-text-primary);
}

.suggestion-location {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.no-results {
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-muted);
    font-style: italic;
}

/* Form errors */
.form-error {
    color: #DC2626;
    font-size: var(--font-size-sm);
    margin-top: var(--space-2);
}

.form-input.error {
    border-color: #DC2626;
}

.form-input.error:focus {
    border-color: #DC2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* How It Works Section */
.how-it-works {
    padding: var(--space-20) 0;
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-12);
    letter-spacing: -0.02em;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-10);
    max-width: 960px;
    margin: 0 auto;
}

.step {
    text-align: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-size: var(--font-size-xl);
    font-weight: 600;
    border-radius: 50%;
    margin-bottom: var(--space-5);
}

.step-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.step-description {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Footer */
.footer {
    padding: var(--space-8) 0;
    border-top: 1px solid var(--color-border);
}

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

.footer-social {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: color 0.15s ease;
}

.footer-social a:hover {
    color: var(--color-accent);
}

.footer-social svg {
    width: 18px;
    height: 18px;
}

.footer-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.footer-love {
    color: var(--color-lake);
    font-weight: 600;
}

.twitter-icon {
    color: var(--color-lake);
}

/* Result pages */
.result-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
}

.result-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
    text-align: center;
    max-width: 480px;
}

.result-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-6);
}

.result-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.result-description {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
    line-height: 1.7;
}

.result-details {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
    text-align: left;
}

.result-detail {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
}

.result-detail:last-child {
    border-bottom: none;
}

.result-detail-label {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.result-detail-value {
    font-weight: 500;
}

.result-link {
    display: inline-block;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.result-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-grid {
        gap: var(--space-10);
    }

    .hero-headline {
        font-size: var(--font-size-4xl);
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: var(--space-10) 0;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
    }

    .hero-description {
        max-width: 100%;
    }

    .hero-stats {
        justify-content: center;
    }

    .form-card {
        max-width: 480px;
        margin: 0 auto;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        gap: var(--space-4);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-5);
    }

    .hero-headline {
        font-size: var(--font-size-3xl);
    }

    .form-card {
        padding: var(--space-6);
    }
}

/* htmx loading indicator */
.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-indicator {
    display: none;
}
