/* Binary Books - Responsive & Mobile-First Optimization */

/* ===== MOBILE NAVIGATION ===== */
.nav-menu.mobile-active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #FFFFFF;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    gap: 1rem;
}

.nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ===== EXTRA SMALL DEVICES (Portrait phones, less than 576px) ===== */
@media (max-width: 575.98px) {
    .container {
        padding: 0 0.75rem;
    }

    .hero {
        padding: 6rem 0 3rem;
    }

    .hero-headline {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero-subtext {
        font-size: 1rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.9rem;
    }

    .btn-large {
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }

    /* Process steps stack vertically */
    .process-steps {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Testimonials single column */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    /* Package cards stack */
    .packages-grid {
        grid-template-columns: 1fr;
    }

    /* Cost items stack */
    .costs-grid,
    .benefits-grid,
    .values-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Form improvements for small screens */
    .contact-form {
        padding: 2rem 1.5rem;
    }

    .option-card {
        padding: 2rem 1.5rem;
    }

    /* Timeline process adjustments */
    .process-step {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .step-number {
        align-self: center;
    }

    /* Stats grid for mobile */
    .mission-stats {
        grid-template-columns: 1fr;
    }

    /* Contact info stacks */
    .contact-info-grid {
        grid-template-columns: 1fr;
    }

    /* FAQ single column */
    .faq-grid {
        grid-template-columns: 1fr;
    }

    /* Transformation before/after stacks */
    .transformation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .arrow {
        transform: rotate(90deg);
    }
}

/* ===== SMALL DEVICES (Landscape phones, 576px and up) ===== */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-headline {
        font-size: 2.25rem;
    }

    .process-steps {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .packages-grid {
        grid-template-columns: 1fr;
    }

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

    .costs-grid,
    .benefits-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* ===== MEDIUM DEVICES (Tablets, 768px and up) ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-headline {
        font-size: 3rem;
    }

    .process-steps {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }

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

    /* Two-column layouts become single column on tablets */
    .mission-content,
    .benefits-content,
    .guarantee-content,
    .principal-content,
    .offer-content,
    .checklist-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ===== LARGE DEVICES (Desktops, 992px and up) ===== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }

    .hero-headline {
        font-size: 3.25rem;
    }
}

/* ===== EXTRA LARGE DEVICES (Large desktops, 1200px and up) ===== */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }

    .hero-headline {
        font-size: 3.5rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .nav,
    .nav-toggle,
    .footer,
    .btn,
    .contact-form,
    .free-offer,
    .final-cta {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    .hero,
    .page-hero {
        padding: 2rem 0;
    }

    .section {
        padding: 1rem 0;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        background-color: #000;
        border-color: #000;
        color: #fff;
    }

    .btn-secondary {
        background-color: #fff;
        border-color: #000;
        color: #000;
    }

    .nav-link:hover {
        background-color: #000;
        color: #fff;
    }
}

/* Dark mode support - DISABLED */
/*@media (prefers-color-scheme: dark) {
    body {
        background-color: #1F2937;
        color: #F9FAFB;
    }

    .header {
        background-color: #111827;
    }

    .logo {
        color: #F9FAFB;
    }

    .nav-link {
        color: #D1D5DB;
    }

    .hero,
    .page-hero {
        background: #F2F0E8;
    }

    .hero-headline,
    .page-title {
        color: #F9FAFB;
    }

    .step,
    .testimonial,
    .package,
    .cost-item,
    .benefit-item {
        background-color: #374151;
        color: #F9FAFB;
    }

    .footer {
        background-color: #000;
    }
}*/

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    .btn {
        padding: 1rem 2rem;
        min-height: 44px;
        touch-action: manipulation;
    }

    .nav-link {
        padding: 0.75rem 1rem;
    }

    .step:hover,
    .package:hover,
    .testimonial:hover {
        transform: none;
    }

    /* Increase touch targets */
    input,
    select,
    textarea,
    button {
        min-height: 44px;
    }
}

/* ===== LANDSCAPE ORIENTATION OPTIMIZATIONS ===== */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        padding: 4rem 0 2rem;
    }

    .hero-headline {
        font-size: 2rem;
    }

    .page-hero {
        padding: 4rem 0 2rem;
    }
}

/* ===== FOCUS STYLES FOR KEYBOARD NAVIGATION ===== */
.btn:focus,
.nav-link:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

.nav-toggle:focus {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== LOADING STATES ===== */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ERROR STATES ===== */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #DC2626;
    background-color: #FEF2F2;
}

.form-group.error label {
    color: #DC2626;
}

.error-message {
    color: #DC2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===== SUCCESS STATES ===== */
.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #10B981;
    background-color: #ECFDF5;
}

.success-message {
    color: #10B981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== UTILITY CLASSES FOR RESPONSIVE BEHAVIOR ===== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 767.98px) {
    .hide-mobile {
        display: none;
    }

    .show-mobile {
        display: block;
    }
}

.text-center-mobile {
    text-align: left;
}

@media (max-width: 767.98px) {
    .text-center-mobile {
        text-align: center;
    }
}