/* CSS Variables */
:root {
    --primary-color: #042554;
    --secondary-color: #073370f1;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

/* Header Styles */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar-brand img {
    height: 70px;
    width: auto;
}

.nav-link.btn {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-link.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
}

/* Plans Section */
#plans {
    position: relative;
}

#plans .bg-primary {
    background: var(--primary-color);
    padding-bottom: 7rem;
}

#plans h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

#plans .container p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.95;
}

/* Plan Cards Container */
.container-xxl {
    margin-top: -4rem;
    position: relative;
    z-index: 10;
}

/* Flip Box Animation */
.flip-box {
    background-color: transparent;
    perspective: 1000px;
    height: 430px;
    box-shadow: var(--shadow-);
}

.flip-box-card {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-box:hover .flip-box-card {
    transform: rotateY(180deg);
}

.flip-box-front, .flip-box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
}

.flip-box-back {
    transform: rotateY(180deg);
}

/* Mobile Flip Box */
.flip-box-mobile:checked + .flip-box-card {
    transform: rotateY(180deg);
}

@media (max-width: 768px) {
    .flip-box:hover .flip-box-card {
        transform: none;
    }
}

/* Card Styles */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 1rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.card ul {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.card ul li {
    margin-bottom: 0.5rem;
}

/* Plan Card Colors */
.flip-box-back .bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

.flip-box-back .bg-success {
    background: linear-gradient(135deg, var(--success-color), #10b981) !important;
}

.flip-box-back .bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #f59e0b) !important;
}

/* Buttons */
.btn {
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary {
    background: var(--primary-color);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #10b981);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #f59e0b);
    border: none;
}

.btn-danger {
    background: #ff6d4d;
    border: none;
    width: auto;
    height: 100%;
}

.btn-danger:hover {
    background: #fc7d61;
}

.saiba-mais {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    margin: -10%;
}

/* Benefits Section */
.bg-light {
    background-color: var(--light-bg) !important;
}

.py-5 {
    padding: 4rem 0;
}

.benefits-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.benefits-section p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 900px;
    margin: 0 auto 3rem;
}

.benefits-section .card {
    border: none;
    background: var(--white);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.benefits-section .card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.benefits-section .card-title {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.benefits-section .card-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Footer */
footer {
    background: var(--text-dark) !important;
    color: var(--white);
    padding: 2rem 0;
    margin-top: 4rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 15px 15px 0 0;
}

.modal-title {
    font-weight: 600;
}

.btn-close {
    filter: invert(1);
}

.modal-body {
    padding: 2rem;
}

.modal-body ul li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.table {
    margin-top: 1rem;
}

.table th {
    background-color: var(--light-bg);
    font-weight: 600;
    color: var(--primary-color);
}

/* Form Styles */
.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.25);
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 25px -5px rgba(37, 211, 102, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    #plans h1 {
        font-size: 2.5rem;
    }
    
    #plans .container p {
        font-size: 1rem;
    }
    
    .card h2 {
        font-size: 2rem;
    }
    
    .benefits-section h2 {
        font-size: 2rem;
    }
    
    .container-xxl {
        margin-top: -3rem;
    }
    
    .flip-box {
        height: auto;
        min-height: 350px;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 40px;
    }
    
    #plans h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Animation Classes */
.animate-flip-left {
    animation: flipInY 0.6s ease-out;
}

@keyframes flipInY {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateY(-20deg);
    }
    60% {
        transform: perspective(400px) rotateY(10deg);
    }
    80% {
        transform: perspective(400px) rotateY(-5deg);
    }
    to {
        transform: perspective(400px);
        opacity: 1;
    }
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.valor-plano {
    font-size: 45px;
    color: var(--primary-color);
    margin-left: 1%;
}

.moeda {
    color: var(--primary-color);
    font-size: 20px;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.shadow {
    box-shadow: var(--shadow) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}


/* Simulator Styles */
.simulator-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-items: center;
    font-family: 'Poppins', sans-serif;
    padding: 2rem;
}

.simulator-container .logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.simulator-container .logo-container img {
    max-width: 250px;
    height: auto;
    width: 250px;
}

.detalhes-plano {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.detalhes-plano h2 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.idade-group {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    max-width: 600px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.idade-group .d-flex {
    flex-grow: 1;
    width: 100%;
    margin-right: 0;
}

.idade-group:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(30, 58, 138, 0.1);
}

.idade-input {
    border: none;
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1.1rem;
    flex: 1;
    margin-right: 0.5rem; /* Mantém um pequeno espaçamento com o botão */
}

.idade-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.btn-custom {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-primary-custom {
    background: var(--primary-color);
    border: none;
    color: white;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 58, 138, 0.3);
    background: var(--secondary-color);
    color: white;
}

.btn-success-custom {
    background:#10b981;
    border: none;
    color: white;
}

.btn-success-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(5, 150, 105, 0.3);
    background: #12d695;
    color: white;
}

.resultado-container {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    margin-top: 2rem;
    animation: slideInUp 0.5s ease-out;
    max-width: 600px;
    width: 100%;
}

.valor-total {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    max-width: 600px;
    width: 100%;
}

/* Simulator responsive */
@media (max-width: 768px) {
    .btn-actions {
        flex-direction: column;
    }
    
    .simulator-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .valor-total {
        font-size: 2rem;
    }
    
    .detalhes-plano,
    .idade-group,
    .resultado-container,
    .btn-actions {
        max-width: 100%;
    }
}

/* Page transitions */
#homePage, #simulatorPage {
    transition: opacity 0.3s ease-in-out;
}

/* Modal de Recém-nascidos */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  z-index: 999;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

#newbornModal {
  position: fixed;
  top: 15%;
  left: 40%;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0px 8px 30px rgba(0,0,0,0.2);
  display: none;
  z-index: 1000;
  animation: scaleIn 0.3s ease;
}
#newbornModal .modal-buttons {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
/* Animações suaves */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

#newbornModal.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

#newbornModal h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#newbornModal .text-muted {
    text-align: center;
    margin-bottom: 2rem;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
}

.newborn-months {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.newborn-months:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 
        0 0 0 4px rgba(4, 37, 84, 0.15),
        inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.newborn-months:hover {
    border-color: #c3cfe2;
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.newborn-preview {
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(5, 150, 105, 0.1);
    border-radius: 8px;
    text-align: center;
}

#newbornError {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 2px solid #f5c6cb;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.modal-buttons .btn {
    flex: 1;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-buttons .btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.modal-buttons .btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    background: linear-gradient(135deg, #20c997, #28a745);
}

.modal-buttons .btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    border: none;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.modal-buttons .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
    background: linear-gradient(135deg, #5a6268, #6c757d);
}

/* Additional responsive fixes */
@media (max-width: 576px) {
    .simulator-container .logo-container img {
        max-width: 200px;
    }
    
    .detalhes-plano {
        padding: 1rem;
    }
    
    .btn-custom {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    #newbornModal {
        width: 95%;
        padding: 1.5rem;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}

