/**
 * @fileoverview This file contains various style improvements and bug fixes for the application.
 */

/* ==========================================
   Improved Header with Authentication
   ========================================== */
.auth-container-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hidden {
    display: none !important;
}

.auth-link-login {
    color: var(--color-graphite);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
}

.auth-link-login:hover {
    color: var(--color-cyan);
}

.auth-dropdown {
    position: relative;
    display: inline-block;
}

.auth-dropdown-btn {
    background-color: var(--color-cyan);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.auth-dropdown-btn:hover {
    background-color: #008f83;
}

.auth-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-radius: 5px;
    margin-top: 10px;
    z-index: 1000;
}

.auth-dropdown-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

.auth-dropdown-menu a {
    color: var(--color-graphite);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.auth-dropdown-menu a:hover {
    background-color: var(--color-light-gray);
    color: var(--color-cyan);
}

.stealth-admin-link {
    font-size: 0.85em;
    opacity: 0.65;
}

.stealth-admin-link:hover {
    opacity: 1;
}

.auth-dropdown-menu a:first-child {
    border-radius: 5px 5px 0 0;
}

.auth-dropdown-menu a:last-child {
    border-radius: 0 0 5px 5px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Enhanced Payment Statuses
   ========================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    gap: 4px;
}

.status-pendente {
    background-color: var(--status-pendente-bg);
    color: var(--status-pendente-text);
}

.status-pago {
    background-color: var(--status-pago-bg);
    color: var(--status-pago-text);
}

.status-confirmado {
    background-color: var(--status-confirmado-bg);
    color: var(--status-confirmado-text);
}

.status-em-andamento {
    background-color: var(--status-em-andamento-bg);
    color: var(--status-em-andamento-text);
}

.status-concluido {
    background-color: var(--status-concluido-bg);
    color: var(--status-concluido-text);
}

.status-cancelado {
    background-color: var(--status-cancelado-bg);
    color: var(--status-cancelado-text);
}

.status-em-aprovacao {
    background-color: var(--status-em-aprovacao-bg);
    color: var(--status-em-aprovacao-text);
}

.status-aprovado {
    background-color: var(--status-aprovado-bg);
    color: var(--status-aprovado-text);
}

.status-reprovado {
    background-color: var(--status-reprovado-bg);
    color: var(--status-reprovado-text);
}

.status-ativa {
    background-color: var(--status-ativa-bg);
    color: var(--status-ativa-text);
}

.status-inativa {
    background-color: var(--status-inativa-bg);
    color: var(--status-inativa-text);
}

/* ==========================================
   Improved Appointment Cards
   ========================================== */
.appointment-card {
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center;
}

.appointment-card:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 10px 30px rgba(0,169,157,0.1);
}

.appointment-info h4 {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--color-graphite);
}

.appointment-info p {
    color: #666;
    font-size: 0.95em;
    margin: 5px 0;
}

.appointment-meta {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    color: #555;
    font-size: 0.9em;
}

.appointment-meta li + li {
    margin-top: 4px;
}

.appointment-meta strong {
    color: var(--color-graphite);
}

.table-meta-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85em;
    color: #4b5563;
}

.table-meta-list li + li {
    margin-top: 4px;
}

.table-meta-list .meta-label {
    font-weight: 600;
    color: var(--color-graphite);
    margin-right: 4px;
}

.appointment-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-small {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-small:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-small .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-top-color: #ffffff;
    animation: spin 0.75s linear infinite;
}

.btn-small.is-loading .spinner {
    display: inline-block;
}

.btn-small.is-loading .btn-label {
    letter-spacing: 0.01em;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-cancel {
    background-color: #E74C3C;
    color: white;
}

.btn-cancel:hover {
    background-color: #C0392B;
}

.btn-rebook {
    background-color: var(--color-cyan);
    color: white;
}

.btn-rebook:hover {
    background-color: #008f83;
}

.btn-pay {
    background-color: #27AE60;
    color: white;
}

.btn-pay:hover {
    background-color: #229954;
}

/* ==========================================
   Additional Fees Table
   ========================================== */
.taxa-section {
    background-color: var(--color-light-gray);
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.taxa-title {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--color-graphite);
}

.taxa-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.taxa-table thead {
    background-color: var(--color-graphite);
    color: white;
}

.taxa-table th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

.taxa-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.taxa-table tbody tr:hover {
    background-color: #f9fafb;
}

.taxa-value {
    font-weight: 700;
    color: var(--color-cyan);
    font-size: 1.1em;
}

.taxa-condition {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* ==========================================
   Discounts and Promotions Section
   ========================================== */
.discount-banner {
    background: linear-gradient(135deg, var(--color-cyan) 0%, #008f83 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: center;
}

.discount-banner h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.discount-banner p {
    font-size: 1.1em;
    margin: 10px 0;
}

.discount-code {
    background-color: rgba(255,255,255,0.2);
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 15px 0;
    font-size: 1.2em;
}

/* ==========================================
   Client Portal - Dashboard
   ========================================== */
.dashboard-header {
    background-color: var(--color-light-gray);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--color-cyan);
}

.dashboard-header h1 {
    font-size: 2em;
    margin-bottom: 5px;
}

.user-greeting {
    font-size: 1.1em;
    color: #666;
}

.section-tabs {
    display: flex;
    gap: 10px;
    margin: 30px 0;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--color-cyan);
    border-bottom-color: var(--color-cyan);
}

.tab-btn:hover {
    color: var(--color-cyan);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================
   Statistics Cards
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 10px 25px rgba(0,169,157,0.1);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 900;
    color: var(--color-cyan);
    margin: 10px 0;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

/* ==========================================
   Confirmation Modal
   ========================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s;
}

.modal-header {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--color-graphite);
}

.modal-body {
    font-size: 1em;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

.modal-btn-primary {
    background-color: var(--color-cyan);
    color: white;
}

.modal-btn-primary:hover {
    background-color: #008f83;
}

.modal-btn-secondary {
    background-color: #e5e7eb;
    color: var(--color-graphite);
}

.modal-btn-secondary:hover {
    background-color: #d1d5db;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ==========================================
   Dynamic Pricing
   ========================================== */
.plan-price-note {
    font-size: 0.95em;
    color: #666;
    margin: 0 0 18px;
    text-align: center;
}

.price-breakdown {
    background: rgba(0, 150, 136, 0.08);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 22px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    text-align: left;
}

.price-breakdown summary {
    font-weight: 600;
    color: var(--color-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-breakdown summary::marker {
    color: var(--color-cyan);
}

.price-breakdown ul {
    list-style: none;
    margin: 12px 0 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.price-breakdown li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.95em;
    color: var(--color-graphite);
}

.price-breakdown li span:first-child {
    font-weight: 600;
}

.price-breakdown li span:last-child {
    font-weight: 600;
    color: var(--color-cyan);
}

.price-breakdown.compact {
    background: rgba(15, 23, 42, 0.04);
}

.price-breakdown.compact li span:last-child {
    color: var(--color-graphite);
}

.plans-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.plan-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plan-card.featured {
    border: 2px solid var(--color-cyan);
    box-shadow: 0 20px 40px rgba(0, 150, 136, 0.18);
    transform: translateY(-6px);
}

.plan-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
}

.plan-card .plan-price {
    align-items: flex-start;
}

.plan-card .plan-price-note {
    text-align: left;
}

.plan-card .price-breakdown {
    margin-bottom: 12px;
}

.plan-badge {
    align-self: flex-start;
    background: var(--color-cyan);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.75em;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.plan-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    color: #444;
    font-size: 0.98em;
}

.plan-benefits li {
    line-height: 1.4;
}

.economy-badge {
    margin-top: auto;
    background: rgba(102, 126, 234, 0.12);
    color: #3b4cca;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 10px;
    text-align: center;
}

.plan-card.featured .economy-badge {
    background: rgba(0, 150, 136, 0.12);
    color: var(--color-cyan);
}

/* ==========================================
   Responsiveness
   ========================================== */
@media (max-width: 768px) {
    .appointment-card {
        grid-template-columns: 1fr;
    }

    .appointment-actions {
        justify-content: flex-start;
    }

    .taxa-table {
        font-size: 0.9em;
    }

    .taxa-table th,
    .taxa-table td {
        padding: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .section-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .modal-content {
        padding: 20px;
    }

    .discount-banner {
        padding: 20px;
    }

    .dashboard-header {
        padding: 20px;
    }

    .dashboard-header h1 {
        font-size: 1.5em;
    }

    .plans-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .plan-card {
        padding: 24px;
    }

    .price-breakdown {
        padding: 12px 14px;
    }
}

/* ==========================================
   Critical Mobile Bug Fixes
   ========================================== */
/* BUG FIX 1: Hide dropdown menu when not in fixed header */
@media (max-width: 768px) {
    /* Fix mobile header - auto height */
    .main-header {
        height: auto !important;
        padding: 15px 5% !important;
        min-height: auto;
    }

    .main-nav {
        flex-direction: row !important;
        flex-wrap: wrap;
        align-items: center !important;
        justify-content: space-between;
        width: 100%;
    }

    .main-nav ul {
        display: none; /* Hide full menu on mobile */
    }

    /* Smaller logo on mobile */
    .logo img {
        height: 50px !important;
        width: auto;
    }

    /* Auth container takes up remaining space */
    .auth-container-header {
        flex: 1;
        display: flex;
        justify-content: flex-end;
        max-width: 60%;
    }

    /* Adjusted dropdown */
    .auth-dropdown {
        width: 100%;
    }

    .auth-dropdown-btn {
        width: 100%;
        font-size: 0.85em;
        padding: 8px 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .auth-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 200px;
        width: auto;
    }

    /* Login links for logged-out users */
    .auth-link-login {
        font-size: 0.9em;
        white-space: nowrap;
    }

    .cta-button-nav {
        font-size: 0.85em;
        padding: 8px 15px;
        white-space: nowrap;
    }
}

/* BUG FIX 2: Mobile hero section */
@media (max-width: 768px) {
    .hero-section {
        padding: 80px 20px 40px 20px !important;
        min-height: 80vh;
        height: auto;
    }

    .hero-section h1 {
        font-size: 2em !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }

    .hero-section p {
        font-size: 1em !important;
        margin-bottom: 30px;
        line-height: 1.6;
    }

    .cta-button-hero {
        font-size: 1em !important;
        padding: 12px 20px !important;
        width: auto;
        max-width: 100%;
        text-align: center;
    }
}

/* BUG FIX 3: Mobile CTA section (Budget) */
@media (max-width: 768px) {
    .cta-section {
        padding: 40px 20px !important;
    }

    .cta-section .section-title {
        font-size: 1.8em !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }

    .cta-section .section-subtitle {
        font-size: 1em !important;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .cta-features {
        flex-direction: column;
        gap: 10px;
        margin: 20px 0;
        font-size: 0.9em;
    }

    .cta-button-hero.large {
        font-size: 1em !important;
        padding: 15px 20px !important;
        width: 100%;
        white-space: normal;
        line-height: 1.4;
    }

    .whatsapp-link {
        font-size: 0.9em;
        margin-top: 15px;
    }
}

/* BUG FIX 4: General mobile container */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
        margin: 0 auto;
    }

    .section-padding {
        padding: 40px 20px;
    }

    .section-title {
        font-size: 1.8em;
        margin-bottom: 30px;
        line-height: 1.3;
    }

    .section-subtitle {
        font-size: 1em;
        line-height: 1.6;
        margin: -20px auto 40px auto;
    }
}

/* BUG FIX 5: Mobile portal - horizontal scroll tabs */
@media (max-width: 768px) {
    .section-tabs {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE 10+ */
        gap: 0;
        margin: 20px -20px;
        padding: 0 20px;
        border-bottom: 2px solid #e5e7eb;
    }

    .section-tabs::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .tab-btn {
        flex-shrink: 0;
        font-size: 0.85em;
        padding: 12px 15px;
        white-space: nowrap;
    }

    .dashboard-header h1 {
        font-size: 1.5em;
        line-height: 1.3;
    }

    .user-greeting {
        font-size: 1em;
    }
}

/* BUG FIX 6: Mobile stats grid */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }

    .stat-card {
        padding: 20px 15px;
    }

    .stat-icon {
        font-size: 2em;
    }

    .stat-value {
        font-size: 1.6em;
    }

    .stat-label {
        font-size: 0.85em;
    }
}

/* BUG FIX 7: Mobile appointment cards */
@media (max-width: 768px) {
    .appointment-card {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 15px;
    }

    .appointment-info h4 {
        font-size: 1em;
    }

    .appointment-info p {
        font-size: 0.9em;
    }

    .appointment-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .status-badge {
        width: 100%;
        text-align: center;
        padding: 8px 12px;
    }

    .btn-small {
        width: 100%;
        padding: 10px 15px;
    }
}

/* BUG FIX 8: Mobile fees table - REWORKED */
@media (max-width: 768px) {
    .taxa-table {
        font-size: 0.85em;
    }

    .taxa-table,
    .taxa-table tbody,
    .taxa-table tr,
    .taxa-table td {
        display: block;
    }

    .taxa-table thead {
        display: none;
    }

    .taxa-table tr {
        margin-bottom: 20px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 15px;
        background-color: white;
    }

    .taxa-table td {
        padding: 8px 0;
        border: none;
        text-align: left;
    }

    .taxa-table td:first-child {
        font-weight: bold;
        color: var(--color-graphite);
        font-size: 1.1em;
        margin-bottom: 5px;
    }

    .taxa-table td:nth-child(2) {
        color: var(--color-cyan);
        font-weight: bold;
        font-size: 1.2em;
        margin: 5px 0;
    }

    .taxa-table td:nth-child(3) {
        color: #666;
        font-style: italic;
        font-size: 0.9em;
    }
}

/* BUG FIX 9: Mobile pricing cards */
@media (max-width: 768px) {
    .pricing-grid {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .pricing-card {
        max-width: 100%;
        width: 100%;
        padding: 30px 20px;
    }

    .pricing-card.featured {
        transform: scale(1);
        order: -1; /* Highlighted on top */
    }

    .plan-price {
        font-size: 2.5em;
    }

    .plan-features li {
        font-size: 0.95em;
    }
}

/* BUG FIX 10: Mobile services grid */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-card {
        padding: 30px 20px;
    }

    .service-icon {
        height: 50px;
    }

    .service-card h3 {
        font-size: 1.2em;
    }

    .service-card p {
        font-size: 0.95em;
    }
}

/* BUG FIX 11: Mobile method timeline */
@media (max-width: 768px) {
    .method-timeline::after {
        left: 30px;
    }

    .method-step {
        margin-bottom: 30px;
    }

    .step-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .step-icon {
        height: 30px;
    }

    .step-content {
        margin-left: 20px;
    }

    .step-content h3 {
        font-size: 1.2em;
        margin-bottom: 8px;
    }

    .step-content p {
        font-size: 0.95em;
    }
}

/* BUG FIX 12: Mobile about section */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-content h2 {
        text-align: center !important;
        font-size: 1.8em;
    }

    .about-content h3 {
        text-align: center;
        margin-top: 0;
        font-size: 1.2em;
    }

    .about-content p {
        text-align: center;
        font-size: 1em;
    }
}

/* BUG FIX 13: Mobile packages grid */
@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .package-card {
        padding: 25px 20px;
    }

    .package-title {
        font-size: 1.4em;
    }

    .package-description {
        font-size: 0.95em;
    }

    .package-discount {
        font-size: 0.95em;
    }
}

/* BUG FIX 14: Mobile footer */
@media (max-width: 768px) {
    .main-footer {
        padding: 40px 0 0 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
        padding: 0 20px;
    }

    .footer-logo {
        height: 40px;
        margin: 0 auto 15px;
    }

    .footer-col h4 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }

    .footer-col p,
    .footer-col ul li {
        font-size: 0.9em;
    }

    .footer-bottom {
        font-size: 0.85em;
        padding: 15px 20px;
    }
}

/* BUG FIX 15: Prevent horizontal scroll */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    img {
        max-width: 100%;
        height: auto;
    }
}

/* BUG FIX 16: Touch targets iOS */
@media (max-width: 768px) {
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px; /* Apple Guidelines */
        font-size: 16px; /* Prevent zoom on focus */
    }

    .cta-button-hero,
    .cta-button-outline,
    .cta-button-nav,
    .btn-small {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* BUG FIX 17: Safe area iOS (notch) */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .main-header {
            padding-top: max(15px, env(safe-area-inset-top));
            padding-left: max(5%, env(safe-area-inset-left));
            padding-right: max(5%, env(safe-area-inset-right));
        }

        body {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* ==========================================
   Global Notifications and Loading States
   ========================================== */
.apex-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2100;
    max-width: min(360px, calc(100vw - 2rem));
}

.apex-toast {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border: 1px solid transparent;
    background: #ffffff;
    color: #1f2933;
    outline: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.apex-toast.is-leaving {
    opacity: 0;
    transform: translateY(-8px);
}

.apex-toast-text {
    flex: 1;
    display: grid;
    gap: 0.35rem;
}

.apex-toast-title {
    font-size: 0.95rem;
    color: inherit;
}

.apex-toast--success {
    border-color: rgba(56, 142, 60, 0.35);
    background: linear-gradient(135deg, rgba(200, 230, 201, 0.85), rgba(232, 245, 233, 0.95));
}

.apex-toast--error {
    border-color: rgba(229, 57, 53, 0.35);
    background: linear-gradient(135deg, rgba(255, 205, 210, 0.9), rgba(255, 235, 238, 0.95));
}

.apex-toast-close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.apex-toast-close:focus-visible,
.apex-toast-close:hover {
    background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 600px) {
    .apex-toast-container {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1.5rem;
    }
}

.apex-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(12, 23, 38, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.apex-loading-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

.apex-loading-content {
    background: #ffffff;
    padding: 1.75rem 2.25rem;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    display: grid;
    justify-items: center;
    gap: 1rem;
    text-align: center;
    max-width: 90vw;
}

.apex-loading-spinner {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 4px solid rgba(0, 169, 157, 0.2);
    border-top-color: var(--color-cyan, #00a99d);
    animation: apex-spin 1s linear infinite;
}

.apex-loading-message {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-graphite, #1f2933);
}

@keyframes apex-spin {
    to {
        transform: rotate(360deg);
    }
}
