:root {
    --primary-color: #01417A;
    --primary-hover: #026ac7;
    --secondary-color: #2ec6d5;
    --text-light: #f8f9fa;
    --text-muted: #6c757d;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 12px 24px rgba(1, 65, 122, 0.15);
    --radius-md: 12px;
    --radius-lg: 20px;
    --font-heading: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: var(--font-heading);
    background-color: #f4f6f9;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Navigation --- */
.nav-pills .nav-link {
    color: var(--primary-color);
    font-weight: 500;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    transition: var(--transition);
}

.nav-pills .nav-link:hover {
    background-color: rgba(1, 65, 122, 0.05);
    color: var(--primary-hover);
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

/* --- Hero & Use Utility --- */
.hero-section {
    padding: 60px 0;
    text-align: center;
}

.title-adir {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.title-adir::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* --- Cards --- */
.card-container-center {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.card-premium {
    border: none;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-premium:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-premium .card-img-top {
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
}

.card-premium:hover .card-img-top {
    transform: scale(1.05);
}

.card-premium .card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card-premium .card-title {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    min-height: 3.75rem;
    /* ~3 lines of text to ensure uniformity */
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-text-adir {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* --- Buttons --- */
.btn-adir {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.btn-adir:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
    box-shadow: 0 4px 12px rgba(1, 65, 122, 0.3);
    transform: translateY(-1px);
}

/* --- Carousel --- */
.carousel {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
    position: relative;
}

.carousel-inner {
    width: 100%;
    height: 100%;
}

/* Ensure images cover the area without distortion */
.carousel-item>img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Keeps image centered */
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover !important;
    z-index: 1;
}

.carousel .carousel-item {
    /* Define the height here - Chromium needs this to be the anchor */
    height: 85vh;
    height: calc(100vh - 130px) !important;
    min-height: 500px !important;
    background-color: #000;
    /* Prevents white flash during transitions */
    position: relative;
}

@media (max-width: 992px) {
    .carousel .carousel-item {
        height: calc(100vh - 130px) !important;
    }
}

@media (max-width: 768px) {
    .carousel .carousel-item {
        height: 60vh !important;
        /* Shorter for mobile view */
        min-height: 400px !important;
    }
}

.carousel-caption {
    z-index: 10;
    background: rgba(1, 65, 122, 0.7);
    backdrop-filter: blur(4px);
    padding: 2rem;
    border-radius: var(--radius-md);
    bottom: 2rem;
}

/* --- Footer --- */
footer {
    padding-top: 3rem;
}

footer h5 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

footer li {
    margin-bottom: 0.8rem;
}

/* --- Login Page --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    padding: 20px;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.login-card h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.login-card .form-control {
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
}

.login-card .form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(46, 198, 213, 0.25);
    background-color: white;
}

/* ============================================
   WhatsApp Floating Bubble
   ============================================ */
#whatsapp-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: fit-content;
    /* Prevents Chrome from stretching to full viewport width */
}

#whatsapp-bubble-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 60px;
    padding: 0 16px;
    background-color: #25D366;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.5);
    text-decoration: none;
    position: relative;
    animation: waBubbleSlideIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) both;
    animation-delay: 0.8s;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.wa-btn-text {
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    line-height: 1;
}

/* Pulse ring */
#whatsapp-bubble-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background-color: #25D366;
    opacity: 0;
    animation: waPulse 2.8s ease-out infinite;
    animation-delay: 1.5s;
}

#whatsapp-bubble-btn:hover,
#whatsapp-bubble-btn:focus {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.6);
    background-color: #1ebe5d;
    outline: none;
}

/* ---- Tooltip card ---- */
.whatsapp-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
    padding: 14px 18px 12px;
    min-width: 246px;
    max-width: 280px;
    border-left: 4px solid var(--primary-color);
    opacity: 0;
    visibility: hidden;
    /* Required for Chrome — opacity:0 alone doesn't suppress background paint */
    transform: translateY(8px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
    pointer-events: none;
}

/* Show tooltip when hovering either button or when either has keyboard focus */
#whatsapp-bubble:has(#cta-call-btn:hover) .whatsapp-tooltip,
#whatsapp-bubble:has(#cta-call-btn:focus) .whatsapp-tooltip,
#whatsapp-bubble:has(#whatsapp-bubble-btn:hover) .whatsapp-tooltip,
#whatsapp-bubble:has(#whatsapp-bubble-btn:focus) .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0s;
    pointer-events: auto;
}

.whatsapp-tooltip-title {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.88rem;
    margin: 0 0 10px 0;
    letter-spacing: 0.2px;
}

.whatsapp-tooltip-hours {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.78rem;
}

.whatsapp-tooltip-hours li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f2f2f2;
    color: var(--text-muted);
}

.whatsapp-tooltip-hours li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.whatsapp-tooltip-hours li span:first-child {
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}

.whatsapp-tooltip-hours li.closed span:last-child {
    color: #dc3545;
    font-weight: 600;
}

/* ---- Animations ---- */
@keyframes waBubbleSlideIn {
    from {
        opacity: 0;
        transform: translateY(32px);
    }

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

@keyframes waPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    70% {
        transform: scale(1.9);
        opacity: 0;
    }

    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

/* ---- Responsive (screen size) ---- */
@media (max-width: 768px) {
    #whatsapp-bubble {
        bottom: 16px;
        right: 16px;
    }

    #whatsapp-bubble-btn {
        width: 52px;
        height: 52px;
        padding: 0;
        border-radius: 50%;
    }

    .wa-btn-text {
        display: none;
    }
}

/* ---- Touch devices — disable tooltip (no real hover on touch screens) ---- */
/* @media (hover: none) targets devices where the primary input is touch.    */
/* This covers Pixel 9, iPhone, iPad etc. — hover is undefined on touch.    */
/* The user taps the button and goes directly to WhatsApp — tooltip not needed. */
@media (hover: none) {
    .whatsapp-tooltip {
        display: none !important;
    }
}



/* ============================================
   "Ligar Agora" Call Button
   ============================================ */
.cta-call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 16px;
    height: 60px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(1, 65, 122, 0.35);
    white-space: nowrap;
    letter-spacing: 0.3px;
    opacity: 0;
    animation: ctaSlideIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) both;
    animation-delay: 0.9s;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.cta-call-btn:hover,
.cta-call-btn:focus {
    background-color: var(--primary-hover);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(1, 65, 122, 0.45);
    outline: none;
}

.cta-call-btn:active {
    transform: scale(0.97);
}

.cta-call-text {
    line-height: 1;
}

/* ---- CTA Slide-in Animation ---- */
@keyframes ctaSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ---- Responsive: mobile ---- */
@media (max-width: 768px) {
    .cta-call-btn {
        width: 52px;
        height: 52px;
        padding: 0;
        border-radius: 50%;
    }

    .cta-call-text {
        display: none;
    }
}