/* Kinetiq Battery Systems - Main Stylesheet 
   Version: 2.0 (High-Performance/Safari Optimized)
*/

:root {
    --brand-green: #5CB828;
    --brand-blue: #002D56;
    --glass-bg: rgba(0, 45, 86, 0.25);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #ffffff;
    min-height: 100dvh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    background-color: #000f1e;
    /* Layered gradient for better text legibility over the image */
    background-image: linear-gradient(rgba(0, 5, 15, 0.85), rgba(0, 15, 30, 0.7)), url('background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    -webkit-overflow-scrolling: touch;
}

/* 1. CONTAINER */
.glass-card {
    max-width: 600px;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 3.5rem 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    isolation: isolate;
}

/* 2. IDENTITY ELEMENTS */
.logo {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 1.6 / 1; 
    margin: 0 auto 1.5rem auto; /* Reduced margin to balance top-heavy look */
    display: block;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.2));
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(92, 184, 40, 0.15);
    border: 1px solid rgba(92, 184, 40, 0.3);
    color: #7ce844;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 50px;
    /* SPACING FIX: Increased to 2.5rem to prevent crowding H1 */
    margin-bottom: 2.5rem; 
}

h1 {
    font-size: clamp(1.5rem, 5vw, 1.85rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-wrap: balance;
}

p.subtitle {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #cfd8e3;
    margin-bottom: 2.5rem;
    text-wrap: pretty;
}

/* 3. THE NO-FLICKER STACK */

.form-container-stack {
    display: grid;
    grid-template-areas: "stack"; 
    width: 100%;
    position: relative;
    align-items: center; 
}

.signup-form {
    grid-area: stack; 
    z-index: 2; 
    display: flex; 
    gap: 12px; 
    flex-wrap: wrap; 
    justify-content: center;
    width: 100%;
    will-change: opacity, transform;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#success-message {
    grid-area: stack; 
    z-index: 1; 
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    text-align: center;
    width: 100%;
    will-change: opacity, transform;
    transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

/* Triggered by JS */
.form-container-stack.submitted .signup-form {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.form-container-stack.submitted #success-message {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
    z-index: 3;
}

/* 4. FORM INPUTS */
input[type="email"] { 
    flex-grow: 1; 
    padding: 14px 18px; 
    background-color: rgba(0, 0, 0, 0.4); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    color: white; 
    border-radius: 8px; 
    font-size: 1rem; 
    outline: none; 
    -webkit-appearance: none;
    transition: border-color 0.2s;
}

input[type="email"]:focus { 
    border-color: var(--brand-green); 
}

button { 
    background-color: var(--brand-green); 
    color: white; 
    font-weight: 700; 
    border: none; 
    padding: 14px 28px; 
    border-radius: 8px; 
    cursor: pointer; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    transition: all 0.2s; 
    -webkit-appearance: none;
}

button:hover { 
    background-color: #4ca31f; 
    box-shadow: 0 0 20px rgba(92, 184, 40, 0.4); 
}

/* 5. FOOTER */
.footer {
    margin-top: 3rem;
    font-size: 0.85rem;
    color: #8899a6;
    letter-spacing: 0.05em;
}

/* 6. MOBILE OVERRIDES */
@media (max-width: 480px) {
    .glass-card {
        padding: 2.5rem 1.5rem;
    }
    .status-badge {
        margin-bottom: 1.75rem;
    }
    .signup-form {
        flex-direction: column;
    }
    .signup-form button { 
        width: 100%; 
    }
}