/* Design System & Variables */
:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(19, 27, 46, 0.75);
    --bg-input: rgba(11, 15, 25, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(6, 182, 212, 0.4);
    
    --primary: #7c3aed; /* Violet */
    --primary-glow: rgba(124, 58, 237, 0.15);
    --secondary: #06b6d4; /* Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.15);
    --success: #10b981; /* Emerald */
    --error: #ef4444; /* Red */
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
    --gradient-glow: linear-gradient(135deg, rgba(124, 58, 237, 0.3) 0%, rgba(6, 182, 212, 0.3) 100%);
    
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Background Glowing Orbs */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.25;
}

.bg-glow-1 {
    top: -100px;
    left: -100px;
    background: var(--primary);
}

.bg-glow-2 {
    bottom: -150px;
    right: -100px;
    background: var(--secondary);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 42px;
    width: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-white);
}

.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--secondary);
    display: inline-block;
}

/* Cards (Glassmorphism) */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

/* Hero Section */
.hero-section {
    padding: 64px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-text {
    max-width: 750px;
    margin-bottom: 40px;
}

.tagline {
    background: var(--primary-glow);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.3);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    color: var(--text-white);
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Search Card */
.search-card {
    width: 100%;
    max-width: 680px;
    padding: 24px;
}

.form-group-cep {
    display: flex;
    width: 100%;
}

.cep-input-wrapper {
    display: flex;
    position: relative;
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 8px 8px 52px;
    transition: var(--transition);
    align-items: center;
}

.cep-input-wrapper:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.cep-input-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-white);
    font-size: 18px;
    width: 100%;
    font-weight: 500;
    letter-spacing: 1px;
}

.cep-input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: normal;
}

.input-icon {
    position: absolute;
    left: 20px;
    font-size: 18px;
    color: var(--text-muted);
    transition: var(--transition);
}

.cep-input-wrapper:focus-within .input-icon {
    color: var(--secondary);
}

/* Buttons */
.btn {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-white);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.btn-submit-form {
    width: 100%;
    background: var(--gradient-primary);
    color: var(--text-white);
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-submit-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(124, 58, 237, 0.5);
}

/* Error Messages */
.error-msg {
    color: var(--error);
    font-size: 14px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* Results Section Layout */
.results-section {
    padding: 32px 24px 64px;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 32px;
}

/* Map Card */
.map-card {
    display: flex;
    flex-direction: column;
}

.card-header {
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.address-text {
    font-size: 15px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

#map-container {
    flex-grow: 1;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    min-height: 400px;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

/* Customize Leaflet elements to dark theme */
.leaflet-container {
    background: #0f172a !important;
}

.leaflet-bar a {
    background-color: var(--bg-card) !important;
    color: var(--text-white) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-bar a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Form Styles */
.form-section {
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 24px;
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.section-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: var(--secondary);
    margin-bottom: 12px;
}

.section-subtext {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: -8px;
    margin-bottom: 16px;
}

/* Option Grid (Radio Cards) */
.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.option-card {
    cursor: pointer;
    position: relative;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-card-content {
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
}

.option-icon {
    font-size: 24px;
    color: var(--text-muted);
    transition: var(--transition);
}

.option-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
}

.option-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.option-card input[type="radio"]:checked + .option-card-content {
    border-color: var(--secondary);
    background: var(--secondary-glow);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

.option-card input[type="radio"]:checked + .option-card-content .option-icon {
    color: var(--secondary);
    transform: scale(1.1);
}

/* Speed Grid (Interactive Buttons) */
.speed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
}

.speed-option {
    cursor: pointer;
    position: relative;
}

.speed-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.speed-option span {
    display: block;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: var(--text-main);
    transition: var(--transition);
}

.speed-option input[type="radio"]:checked + span {
    background: var(--secondary-glow);
    border-color: var(--secondary);
    color: var(--text-white);
}

.mt-3 {
    margin-top: 16px;
}

.mt-2 {
    margin-top: 8px;
}

/* Toggle Grid (Yes/No) */
.toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 250px;
}

.toggle-option {
    cursor: pointer;
    position: relative;
}

.toggle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-option span {
    display: block;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: var(--text-main);
    transition: var(--transition);
}

.toggle-option input[type="radio"]:checked + span {
    background: var(--secondary-glow);
    border-color: var(--secondary);
    color: var(--text-white);
}

/* Form Inputs */
.input-group {
    margin-bottom: 12px;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 14px 14px 44px;
    color: var(--text-white);
    font-family: var(--font-family);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--secondary);
}

.input-wrapper .input-icon {
    top: 50%;
    transform: translateY(-50%);
    left: 16px;
    pointer-events: none;
}

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

/* Success Card */
.success-section {
    padding: 64px 24px;
    display: flex;
    justify-content: center;
}

.success-card {
    max-width: 600px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px;
}

.success-icon {
    font-size: 64px;
    color: var(--success);
    margin-bottom: 24px;
    filter: drop-shadow(0 0 15px rgba(16, 185, 129, 0.3));
}

.success-card h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 16px;
}

.success-card p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
}

.highlight-email {
    color: var(--secondary);
    font-weight: 600;
}

.summary-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: left;
    margin-bottom: 32px;
}

.summary-box h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.summary-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-box li {
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.summary-box li span:first-child {
    color: var(--text-muted);
}

.summary-box li span:last-child {
    color: var(--text-white);
    font-weight: 600;
}

.follow-up-text {
    font-size: 13px !important;
    font-style: italic;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Loader Animation */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

/* Screen Reader Only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Footer */
.footer {
    margin-top: auto;
    background: rgba(11, 15, 25, 0.9);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-small {
    font-size: 12px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 992px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    
    #map-container {
        min-height: 350px;
    }
}

@media (max-width: 600px) {
    .hero-section {
        padding: 40px 16px 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .option-grid {
        grid-template-columns: 1fr;
    }
    
    .speed-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .success-card {
        padding: 24px 16px;
    }
}
