/* Page-specific rules extracted from browser EJS views. */

/* Admin and policy detail layouts */
body.admin-page main,
body.policy-details-page main {
    max-height: 100vh;
    overflow-y: scroll;
}

body.admin-dashboard .stat-card {
    transition: all 0.3s ease;
}

body.admin-dashboard .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* CSP-safe native progress indicators */
.progress-track {
    display: block;
    width: 100%;
    height: 0.5rem;
    border: 0;
    border-radius: 9999px;
    overflow: hidden;
    background: #e5e7eb;
    appearance: none;
    -webkit-appearance: none;
}

.progress-track::-webkit-progress-bar {
    background: #e5e7eb;
    border-radius: 9999px;
}

.progress-track::-webkit-progress-value {
    background: #35296a;
    border-radius: 9999px;
}

.progress-track::-moz-progress-bar {
    background: #35296a;
    border-radius: 9999px;
}

.progress-track.progress-green::-webkit-progress-value,
.progress-track.progress-active::-webkit-progress-value {
    background: #22c55e;
}

.progress-track.progress-green::-moz-progress-bar,
.progress-track.progress-active::-moz-progress-bar {
    background: #22c55e;
}

.progress-track.progress-yellow::-webkit-progress-value,
.progress-track.progress-pending::-webkit-progress-value {
    background: #eab308;
}

.progress-track.progress-yellow::-moz-progress-bar,
.progress-track.progress-pending::-moz-progress-bar {
    background: #eab308;
}

.progress-track.progress-red::-webkit-progress-value,
.progress-track.progress-cancelled::-webkit-progress-value {
    background: #ef4444;
}

.progress-track.progress-red::-moz-progress-bar,
.progress-track.progress-cancelled::-moz-progress-bar {
    background: #ef4444;
}

.progress-track.progress-expired::-webkit-progress-value {
    background: #6b7280;
}

.progress-track.progress-expired::-moz-progress-bar {
    background: #6b7280;
}

.progress-track.progress-primary::-webkit-progress-value {
    background: #35296a;
}

.progress-track.progress-primary::-moz-progress-bar {
    background: #35296a;
}

.strength-0 { width: 0%; }
.strength-20 { width: 20%; }
.strength-35 { width: 35%; }
.strength-45 { width: 45%; }
.strength-70 { width: 70%; }
.strength-100 { width: 100%; }

.password-strength-bar {
    display: block;
    height: 0.375rem;
    border: 0;
    border-radius: 9999px;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
}

.password-strength-bar::-webkit-progress-bar {
    background: #e2e8f0;
    border-radius: 9999px;
}

.password-strength-bar::-moz-progress-bar,
.password-strength-bar::-webkit-progress-value {
    border-radius: 9999px;
}

.password-strength-bar.bg-slate-200::-webkit-progress-value,
.password-strength-bar.bg-slate-200::-moz-progress-bar { background: #e2e8f0; }
.password-strength-bar.bg-red-500::-webkit-progress-value,
.password-strength-bar.bg-red-500::-moz-progress-bar { background: #ef4444; }
.password-strength-bar.bg-orange-500::-webkit-progress-value,
.password-strength-bar.bg-orange-500::-moz-progress-bar { background: #f97316; }
.password-strength-bar.bg-amber-500::-webkit-progress-value,
.password-strength-bar.bg-amber-500::-moz-progress-bar { background: #f59e0b; }
.password-strength-bar.bg-emerald-500::-webkit-progress-value,
.password-strength-bar.bg-emerald-500::-moz-progress-bar { background: #10b981; }

/* Underwriter product editor toggle switches */
body.underwriter-product-editor .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

body.underwriter-product-editor .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

body.underwriter-product-editor .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

body.underwriter-product-editor .slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

body.underwriter-product-editor .switch input:checked + .slider {
    background-color: rgb(53, 41, 106);
}

body.underwriter-product-editor .switch input:checked + .slider::before {
    transform: translateX(20px);
}

/* Checkout payment, traveler, and step indicators */
body.checkout-page .payment-card {
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

body.checkout-page .payment-card.selected {
    border-color: #e87027;
    background-color: #fff7ed;
}

body.checkout-page .traveler-card {
    transition: all 0.2s;
}

body.checkout-page .traveler-card.primary {
    border-left: 4px solid #e87027;
    background-color: #fef9e6;
}

body.checkout-page .step-indicator {
    transition: all 0.3s ease;
}

body.checkout-page .step-indicator.active {
    border-bottom-color: #e87027;
    color: #352e74;
}

body.checkout-page .step-indicator.completed {
    border-bottom-color: #10b981;
    color: #10b981;
}

/* Product detail pages */
body.product-page {
    --cannon-primary: rgb(53, 41, 106);
    --cannon-secondary: rgb(240, 103, 36);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
}

body.product-page .skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--cannon-primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 0 0 6px 6px;
    z-index: 100;
    font-size: 0.875rem;
    font-weight: 500;
    transition: top 0.3s;
    text-decoration: none;
}

body.product-page .skip-link:focus {
    top: 0;
}

body[data-buy-url="/plans/corporate"] .hero-bg {
    background-image: url('/images/learnMore/corprate.jpg');
    background-size: cover;
    background-position: center 50%;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body[data-buy-url="/plans/domestic"] .hero-bg {
    background-image: url('/images/learnMore/learnMoreDomestic2.jpg');
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body[data-buy-url="/plans/pilgrimage"] .hero-bg {
    background-image: url('/images/learnMore/learnMorePilgrimage.jpg');
    background-size: cover;
    background-position: center 15%;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body[data-buy-url="/plans/students"] .hero-bg {
    background-image: url('/images/learnMore/learnMoreStudents4.jpg');
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body[data-buy-url="/plans/standard"] .hero-bg {
    background-image: url('/images/learnMore/learnMoreStandard.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body.product-page .benefit-table-row {
    transition: background-color 0.15s ease;
}

body.product-page .benefit-table-row:hover {
    background-color: rgba(53, 41, 106, 0.02);
}

body.product-page .cta-pulse {
    animation: ctaPulse 2.5s ease-in-out infinite;
}

@keyframes ctaPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(240, 103, 36, 0.4);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(240, 103, 36, 0);
    }
}

@media print {
    body.product-page .no-print {
        display: none !important;
    }

    body.product-page {
        font-size: 10pt;
        background: #fff;
    }
}

/* Quote page */
body.quote-page {
    box-sizing: border-box;

    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    color: #1e293b;
    line-height: 1.5;
    scroll-behavior: smooth;
}

body.quote-page .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Benefits grid (no CTAs, just visuals) */
body.quote-page .benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 2rem;
    margin: 1rem 0 2rem;
}

body.quote-page .benefit-item {
    background: #fafcff;
    text-align: center;
    padding: 1.8rem 1rem;
    border-radius: 1.5rem;
    border: 1px solid #edf2f7;
    transition: 0.2s;
}

body.quote-page .benefit-item:hover {
    border-color: #cde1f0;
    background: #ffffff;
    transform: translateY(-3px);
}

body.quote-page .benefit-icon {
    font-size: 2.5rem;
    color: #35296a;
    margin-bottom: 1rem;
}

body.quote-page .benefit-item h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

body.quote-page .benefit-item p {
    font-size: 0.85rem;
    color: #4b5e77;
}

/* Hero with background image (pixels speak) */
body.quote-page .hero {
    background: linear-gradient(105deg, #f8f7fb 0%, #f3f4f6 100%);
    padding: 4rem 0 5rem;
    position: relative;
}

body.quote-page .hero-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

body.quote-page .hero-content {
    flex: 1.2;
}

body.quote-page .hero-badge {
    background: #eae8f2;
    color: #f06724;
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
}

body.quote-page .hero h2 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #35296a;
    margin-bottom: 1.2rem;
}

body.quote-page .hero p {
    font-size: 1.1rem;
    color: #475569;
    max-width: 90%;
    margin-bottom: 2rem;
}

body.quote-page .hero-image {
    flex: 0.9;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.1);
}

body.quote-page .hero-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

@media (max-width: 768px) {
    body.quote-page .hero h2 {
        font-size: 2rem;
    }

    body.quote-page .hero-content p {
        max-width: 100%;
    }

    body.quote-page .plan-grid {
        gap: 1rem;
    }
}

/* Terms and conditions page */
body.terms-page {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
}

body.terms-page .prose-custom {
    line-height: 1.55;
}

body.terms-page .section-card {
    transition: all 0.1s ease;
}

@media (prefers-color-scheme: dark) {
    body.terms-page .dark\:bg-gray-950 subtle {
        background-color: #0a0a0a;
    }
}

/* Login animation */
@keyframes loginFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-20px) rotate(-2deg);
    }

    66% {
        transform: translateY(-10px) rotate(2deg);
    }
}

body.login-page .animate-float {
    animation: loginFloat 6s ease-in-out infinite;
}

/* Customer dashboard sidebar */
.customer-sidebar {
    background: rgb(53, 41, 106);
    color: #fff;
}

.customer-sidebar-footer {
    background: rgb(45, 31, 95);
}

.customer-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: #fff;
}

.customer-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
}
