/* ========================================
   CSS Variables & Design Tokens
======================================== */
:root {
    /* Primary Colors - Blue theme for Gas & Water */
    --primary-hue: 210;
    --primary: hsl(var(--primary-hue), 85%, 50%);
    --primary-dark: hsl(var(--primary-hue), 85%, 40%);
    --primary-light: hsl(var(--primary-hue), 85%, 60%);
    --primary-glow: hsla(var(--primary-hue), 85%, 50%, 0.25);

    /* Secondary - Teal/Cyan for accents */
    --secondary-hue: 190;
    --secondary: hsl(var(--secondary-hue), 80%, 45%);
    --secondary-light: hsl(var(--secondary-hue), 80%, 55%);

    /* Background - Light mode with clean whites */
    --bg-primary: hsl(210, 30%, 98%);
    --bg-secondary: hsl(210, 25%, 95%);
    --bg-card: hsl(0, 0%, 100%);
    --bg-card-hover: hsl(210, 30%, 97%);

    /* Glass effect - Light mode */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);

    /* Text - Dark text on light background */
    --text-primary: hsl(220, 25%, 15%);
    --text-secondary: hsl(220, 15%, 45%);
    --text-muted: hsl(220, 10%, 60%);

    /* Status */
    --success: hsl(145, 65%, 42%);
    --error: hsl(0, 75%, 55%);
    --warning: hsl(40, 90%, 50%);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows - Light mode */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px var(--primary-glow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Background Decorations
======================================== */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    bottom: 10%;
    left: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    top: 50%;
    right: 10%;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* ========================================
   Layout
======================================== */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

/* Mobile: Allow natural scroll */
@media (max-width: 767px) {
    .container {
        min-height: auto;
        justify-content: flex-start;
        padding-top: var(--space-xl);
        padding-bottom: var(--space-xl);
    }
}

/* ========================================
   Card Component
======================================== */
.card {
    width: 100%;
    max-width: 440px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.6s ease-out;
}

/* Mobile: Full width card */
@media (max-width: 575px) {
    .card {
        max-width: 100%;
        border-radius: var(--radius-lg);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Logo & Branding
======================================== */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo-text span {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: var(--space-xl);
}

/* ========================================
   Features Grid
======================================== */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-sm);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.feature:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.5rem;
}

.feature span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* ========================================
   Form Section
======================================== */
.form-section {
    margin-bottom: var(--space-xl);
}

.form-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    text-align: center;
}

.form-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-lg);
}

/* ========================================
   Input Styles
======================================== */
.input-group {
    margin-bottom: var(--space-lg);
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    padding-right: 3rem;
    font-size: 1.125rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-base);
    letter-spacing: 0.1em;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-wrapper input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px hsla(0, 80%, 60%, 0.2);
}

.input-wrapper input.success {
    border-color: var(--success);
    box-shadow: 0 0 0 4px hsla(145, 70%, 50%, 0.2);
}

.input-icon {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-base);
}

.input-wrapper input:focus+.input-icon {
    color: var(--primary);
}

.error-message {
    display: block;
    font-size: 0.8rem;
    color: var(--error);
    margin-top: var(--space-sm);
    min-height: 1.2rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all var(--transition-fast);
}

.error-message.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Button Styles
======================================== */
.btn-primary {
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:hover::before {
    left: 100%;
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

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

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Trust Badges
======================================== */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--glass-border);
}

.badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge-icon {
    font-size: 1rem;
}

/* ========================================
   Footer
======================================== */
.footer {
    margin-top: var(--space-xl);
    text-align: center;
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   Responsive Design - Desktop First
======================================== */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }

    .card {
        max-width: 520px;
        padding: var(--space-3xl);
    }

    .logo-text {
        font-size: 2.5rem;
    }

    .logo-icon {
        width: 56px;
        height: 56px;
    }

    .logo-icon svg {
        width: 32px;
        height: 32px;
    }

    .tagline {
        font-size: 1.125rem;
    }

    .features {
        gap: var(--space-md);
    }

    .feature {
        padding: var(--space-lg) var(--space-md);
    }

    .feature-icon {
        font-size: 1.75rem;
    }

    .feature span {
        font-size: 0.85rem;
    }

    .form-section h2 {
        font-size: 1.5rem;
    }

    .input-wrapper input {
        font-size: 1.25rem;
        padding: var(--space-lg);
    }

    .btn-primary {
        font-size: 1.1rem;
        padding: var(--space-lg) var(--space-xl);
    }

    .trust-badges {
        gap: var(--space-2xl);
    }

    .badge {
        font-size: 0.875rem;
    }
}

/* Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .card {
        max-width: 480px;
    }

    .logo-text {
        font-size: 2.25rem;
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .card {
        max-width: 450px;
    }

    .logo-text {
        font-size: 2rem;
    }

    .features {
        gap: var(--space-sm);
    }
}

/* Small Tablet / Large Mobile (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .card {
        max-width: 420px;
    }
}

/* Mobile (max 575px) */
@media (max-width: 575px) {
    .container {
        padding: var(--space-md);
    }

    .card {
        padding: var(--space-lg);
        border-radius: var(--radius-lg);
    }

    .logo-text {
        font-size: 1.75rem;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .logo-icon svg {
        width: 24px;
        height: 24px;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .features {
        gap: var(--space-xs);
    }

    .feature {
        padding: var(--space-sm);
    }

    .feature-icon {
        font-size: 1.25rem;
    }

    .feature span {
        font-size: 0.7rem;
    }

    .form-section h2 {
        font-size: 1.1rem;
    }

    .form-description {
        font-size: 0.8rem;
    }

    .input-wrapper input {
        font-size: 1rem;
        padding: var(--space-md);
    }

    .btn-primary {
        font-size: 0.95rem;
        padding: var(--space-md);
    }

    .trust-badges {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
    }

    .badge {
        font-size: 0.7rem;
    }
}

/* ========================================
   Address Page Styles
======================================== */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.step.active .step-number {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.step.completed .step-number {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: none;
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--bg-secondary);
    transition: background var(--transition-base);
}

.step-connector.active {
    background: linear-gradient(90deg, var(--success), var(--primary));
}

@media (min-width: 480px) {
    .step-label {
        display: block;
    }
}

.cep-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.cep-display svg {
    width: 20px;
    height: 20px;
    color: var(--success);
}

.cep-display span {
    font-weight: 600;
    letter-spacing: 0.1em;
}

.cep-display a {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    margin-left: auto;
    transition: color var(--transition-base);
}

.cep-display a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

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

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.input-wrapper input[readonly] {
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: not-allowed;
}