:root {
    /* Grounding the UI in a deep, organic dark gradient extracted from the logo shades */
    --bg-gradient: linear-gradient(135deg, #0f140e 0%, #1a080a 100%);
    
    /* Using a warm cream tint for the glass translucent base */
    --glass-bg: rgba(250, 245, 231, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(250, 245, 231, 0.18);
    
    /* Typography tokens */
    --text-primary: #faf5e7;       /* Rich warm cream */
    --text-secondary: #a3b09a;     /* Muted sage fallback */
    
    /* Logo-derived brand accents */
    --brand-crimson: #b81d33;      /* Top ribbon red */
    --brand-maroon: #6b0012;       /* Deep left ribbon maroon */
    --brand-sage: #a1c16d;         /* Light ribbon green (perfect for success/focus) */
    --brand-olive: #556238;        /* Dark ribbon green */
    
    /* Interactive states mapped to the logo palette */
    --accent-glow: var(--brand-sage);
    --error-color: #f87171;        /* Keeps error legibility high, tinted by crimson */
    --success-color: var(--brand-sage);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Liquid Blobs - Now matching the logo ribbon colors */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    z-index: 0;
    opacity: 0.25;
    animation: float 14s infinite alternate ease-in-out;
}
.blob1 {
    width: 450px;
    height: 450px;
    background: var(--brand-maroon);
    top: -5%;
    left: 8%;
}
.blob2 {
    width: 500px;
    height: 500px;
    background: var(--brand-olive);
    bottom: -10%;
    right: 5%;
    animation-delay: -7s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(40px) scale(1.05); }
}

/* Glassmorphic Container */
.form-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-left: 1px solid var(--glass-highlight);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    z-index: 10;
    margin: 20px;
}

h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: -0.02em;
    /* Soft gradient transition on the heading matching the cream-to-sage transition */
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Form Layout Elements */
.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 20px;
    position: relative;
}

label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 4px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

input {
    background: rgba(15, 20, 14, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input::placeholder {
    color: rgba(163, 176, 154, 0.3);
}

input:focus {
    border-color: var(--accent-glow);
    box-shadow: 0 0 0 4px rgba(161, 193, 109, 0.15);
    background: rgba(15, 20, 14, 0.7);
}

/* Validation Visual States */
.error-msg {
    font-size: 0.78rem;
    color: var(--error-color);
    margin-top: 5px;
    min-height: 16px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    padding-left: 4px;
}

.input-group.invalid-field input {
    border-color: var(--brand-crimson);
    box-shadow: 0 0 0 4px rgba(184, 29, 51, 0.15);
}

.input-group.invalid-field .error-msg {
    opacity: 1;
    transform: translateY(0);
}

/* Call-to-Action Interactive Element */
button {
    width: 100%;
    background: var(--brand-crimson);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(184, 29, 51, 0.2);
}

button:hover {
    transform: translateY(-2px);
    background: #cd243b;
    box-shadow: 0 8px 25px rgba(184, 29, 51, 0.35);
}

button:active {
    transform: translateY(0);
}

.form-result {
    font-size: 1rem;
    margin-top: 20px;
    font-weight: 500;
    text-align: center;
}

.form-result.success { color: var(--success-color); }
.form-result.error { color: var(--brand-crimson); }