* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Nordic/Mountaineering/Sunset Color Palette - ClimberIQ Brand */

    /* Primary - Deep Fjord Blue */
    --primary: #1E3A5F;
    --primary-dark: #152A45;
    --primary-light: #2D5A8A;

    /* Secondary - Sunset Orange/Amber */
    --secondary: #E07B39;
    --secondary-dark: #C4612A;
    --secondary-light: #F4976C;

    /* Accent - Nordic Aurora Teal */
    --accent: #2A9D8F;

    /* Sunset tones */
    --sunset-gold: #F2A93B;
    --sunset-rose: #D4726A;

    /* Semantic */
    --success: #2A9D8F;
    --warning: #F2A93B;
    --danger: #D4726A;

    /* Neutrals */
    --charcoal: #1C1C1E;
    --slate: #4A4A4C;
    --stone: #6B6B6D;
    --cloud: #F5F3F0;
    --snow: #FAFAF8;
    --white: #FFFFFF;

    /* Shadows */
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15), 0 6px 6px rgba(0,0,0,0.10);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 40%, var(--secondary) 80%, var(--sunset-gold) 100%);
    min-height: 100vh;
    color: var(--charcoal);
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 32px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.brand-link {
    display: inline-block;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.brand-link:hover {
    color: white;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 1.5rem;
    color: var(--charcoal);
    margin-bottom: 8px;
}

.card-header p {
    color: var(--slate);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--charcoal);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1.1rem;
    border: 2px solid #E5E5E5;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(224, 123, 57, 0.15);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: var(--danger);
}

.form-group input.valid {
    border-color: var(--success);
}

.help-text {
    display: block;
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--stone);
}

.error-text {
    display: block;
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--danger);
    min-height: 20px;
}

.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 0.8125rem;
    color: var(--stone);
}

.privacy-note svg {
    flex-shrink: 0;
    color: var(--success);
}

.form-group input.error {
    border-color: var(--danger);
}

button[type="submit"] {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--sunset-gold) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(224, 123, 57, 0.3);
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(224, 123, 57, 0.4);
}

button[type="submit"]:active {
    transform: translateY(0);
}

button[type="submit"]:disabled {
    background: #CCCCCC;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loading {
    display: none !important;
    align-items: center;
    gap: 8px;
}

.btn-loading.show {
    display: inline-flex !important;
}

/* Hide btn-text when loading is shown */
.btn-text.hide {
    display: none !important;
}

/* Support for hidden attribute */
[hidden] {
    display: none !important;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.info-box {
    margin-top: 24px;
    padding: 20px;
    background: var(--cloud);
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
}

.info-box h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--charcoal);
}

.info-box ul {
    list-style: none;
}

.info-box li {
    padding: 6px 0;
    color: var(--slate);
}

.info-box li strong {
    color: var(--charcoal);
}

/* SWOT color coding */
.info-box li strong:first-child {
    display: inline-block;
    width: 110px;
}

.info-box li:nth-child(1) strong:first-child { color: var(--success); }
.info-box li:nth-child(2) strong:first-child { color: var(--danger); }
.info-box li:nth-child(3) strong:first-child { color: var(--primary-light); }
.info-box li:nth-child(4) strong:first-child { color: var(--sunset-gold); }

.help-card {
    background: var(--cloud);
}

.help-card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--charcoal);
}

.help-card ol {
    padding-left: 20px;
}

.help-card li {
    padding: 8px 0;
    color: var(--slate);
}

.help-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.help-card a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.9);
    font-size: 0.875rem;
}

footer a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .container {
        padding: 20px 16px;
    }

    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 24px;
    }
}

/* Email Gate Modal Styles */
.email-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.email-gate-modal {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    margin: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.email-gate-header {
    text-align: center;
    margin-bottom: 28px;
}

.email-gate-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(42, 157, 143, 0.1) 0%, rgba(30, 58, 95, 0.1) 100%);
    border-radius: 16px;
}

.email-gate-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--charcoal);
    margin: 0 0 12px 0;
}

.email-gate-header p {
    color: var(--slate);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.email-gate-form {
    margin-bottom: 20px;
}

.email-input-group {
    display: flex;
    gap: 12px;
}

.email-input-group input {
    flex: 1;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 8px 0 0 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.email-input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1);
}

.email-input-group input.error {
    border-color: var(--danger);
}

.email-submit-btn {
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.3);
}

.email-submit-btn:hover {
    background: linear-gradient(135deg, #238a7f 0%, var(--primary-dark) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(42, 157, 143, 0.4);
}

.email-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin: 8px 0 0 0;
    min-height: 20px;
}

.email-gate-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--slate);
    font-size: 0.8125rem;
    margin: 0;
}

.email-gate-privacy svg {
    flex-shrink: 0;
    color: var(--success);
}

@media (max-width: 480px) {
    .email-gate-overlay {
        flex-direction: column;
    }

    .email-gate-modal {
        padding: 28px;
        margin: 16px;
    }

    .email-input-group {
        flex-direction: column;
    }

    .email-input-group input {
        border-radius: 8px;
    }

    .email-submit-btn {
        border-radius: 8px;
        width: 100%;
        justify-content: center;
    }
}
