/* ==========================================================================
   CSS Variables & Design Tokens
   ========================================================================== */
:root {
    /* Color Palette */
    --color-primary-gold: #d4af37;
    --color-primary-gold-hover: #c5a059;
    --color-gold-light: #f7e7c4;
    --color-bg-dark: #0c0c0e;
    --color-bg-panel: rgba(12, 12, 14, 0.82);
    --color-bg-panel-mobile: rgba(12, 12, 14, 0.92);
    --color-input-bg: rgba(24, 24, 28, 0.7);
    --color-input-border: rgba(255, 255, 255, 0.1);
    --color-input-focus-border: #d4af37;
    --color-text-primary: #ffffff;
    --color-text-secondary: #a0a0ab;
    --color-text-dark: #0c0c0e;
    --color-error: #ef4444;
    --color-success: #10b981;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-out;

    /* Layout & Shadows */
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 50px rgba(212, 175, 55, 0.05);
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    background-color: var(--color-bg-dark);
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==========================================================================
   Hero Container Layout
   ========================================================================== */
.hero-container {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    background-image: url('images/bg-campanha-dia-dos-pais-mabe.webp');
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
}

/* Background Overlay for ensuring contrast on small viewports */
.background-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(12, 12, 14, 0.9) 0%, rgba(12, 12, 14, 0.6) 40%, rgba(12, 12, 14, 0.2) 100%);
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   Content Panel (Left Column)
   ========================================================================== */
.content-panel {
    position: relative;
    z-index: 2;
    width: 42%;
    min-width: 480px;
    max-width: 600px;
    background: var(--color-bg-panel);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(212, 175, 55, 0.15);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

/* Logo Header */
.logo-header {
    margin-bottom: 40px;
}

.mabe-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: var(--transition-smooth);
}

.mabe-logo:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* Typography & Hero Text */
.hero-text {
    margin-bottom: 35px;
}

.campaign-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-primary-gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 20px;
    background: rgba(212, 175, 55, 0.05);
}

.main-headline {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ffffff 60%, var(--color-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subheadline {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-weight: 300;
}

/* ==========================================================================
   Premium Form Elements
   ========================================================================== */
.premium-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.02em;
}

.input-icon {
    width: 16px;
    height: 16px;
    color: var(--color-primary-gold);
    opacity: 0.8;
}

/* Input & Select Common styles */
.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    padding-left: 16px;
    background-color: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:hover,
.form-group select:hover {
    border-color: rgba(212, 175, 55, 0.4);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--color-input-focus-border);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
    background-color: rgba(24, 24, 28, 0.95);
}

/* Custom Select wrapper to override browser styles */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 45px;
    cursor: pointer;
}

/* Specific placeholder styling for selects */
.custom-select-wrapper select:invalid,
.custom-select-wrapper select option[value=""] {
    color: var(--color-text-secondary);
}

.select-chevron {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-secondary);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.custom-select-wrapper select:focus + .select-chevron {
    color: var(--color-primary-gold);
    transform: translateY(-50%) rotate(180deg);
}

/* Conditional Field CSS & Animation */
.conditional-field {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    margin-top: -12px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease, 
                margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.conditional-field.show {
    max-height: 120px; /* enough space for input + label */
    opacity: 1;
    visibility: visible;
    margin-top: 0;
    margin-bottom: 8px;
}

/* Error Messages */
.error-msg {
    font-size: 0.75rem;
    color: var(--color-error);
    display: none;
    margin-top: 4px;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.form-group.invalid input,
.form-group.invalid select {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-group.invalid .error-msg {
    display: flex;
}

/* Submit Button */
.submit-btn {
    margin-top: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--color-primary-gold) 0%, #b59410 100%);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--color-text-dark);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-25deg);
    transition: 0.75s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.submit-btn:hover::after {
    left: 125%;
}

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

.btn-arrow {
    width: 18px;
    height: 18px;
    transition: var(--transition-smooth);
}

.submit-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* ==========================================================================
   Success State Layout
   ========================================================================== */
.success-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 10px;
    animation: fadeInScale 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--color-success);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    color: var(--color-success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.success-icon {
    width: 36px;
    height: 36px;
}

.success-panel h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #ffffff;
}

.success-panel p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: 30px;
}

.success-panel p strong {
    color: var(--color-primary-gold);
    font-weight: 600;
}

.reset-btn {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-primary);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.reset-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--color-primary-gold);
    color: var(--color-primary-gold);
}

/* Footer Panel */
.panel-footer {
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    text-align: center;
}

.panel-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Responsive & Adaptive Queries
   ========================================================================== */

/* Large screens: Adjust content column width dynamically */
@media (min-width: 1400px) {
    .content-panel {
        width: 35%;
        padding: 80px 60px;
    }
}

/* Medium viewports (Tablets and small desktops) */
@media (max-width: 1024px) {
    .hero-container {
        justify-content: center;
        align-items: center;
        padding: 40px 20px;
        background-position: center;
    }

    .background-overlay {
        background: rgba(12, 12, 14, 0.75); /* Darker backdrop to support centering card */
    }

    .content-panel {
        width: 100%;
        max-width: 520px;
        min-width: unset;
        background: var(--color-bg-panel-mobile);
        border: 1px solid rgba(212, 175, 55, 0.15);
        border-radius: var(--border-radius-lg);
        box-shadow: var(--shadow-premium);
        padding: 45px 35px;
        overflow-y: visible;
    }
}

/* Small viewports (Mobile devices) */
@media (max-width: 480px) {
    .hero-container {
        padding: 20px 10px;
    }

    .content-panel {
        padding: 30px 20px;
    }

    .main-headline {
        font-size: 1.75rem;
    }

    .subheadline {
        font-size: 0.88rem;
    }

    .form-group input,
    .form-group select {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
    
    .logo-header {
        margin-bottom: 25px;
    }
}
