/* ═══════════════════════════════════════════════════════════════════════
   CloudPortal Frontend — Custom Styles
   Beyond Tailwind utility classes. Liquid glass effects, animations,
   mega menu styling, and component-level refinements.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────────────── */
:root {
    --brand: #34a980;
    --brand-light: #6ee7b3;
    --brand-dark: #267a5e;
    --accent: #f97316;
    --accent-light: #fb923c;
    --accent-dark: #c2410c;
    --cream: #fff7ed;
    --cream-deep: #fef3e2;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
}

/* ── Cream Background Helper ────────────────────────────────────────── */
.bg-cream {
    background: var(--cream);
}

.bg-cream-deep {
    background: var(--cream-deep);
}

/* ── Wave Dividers ──────────────────────────────────────────────────── */
/*
 * Wave dividers are absolutely positioned at the top/bottom edge of their
 * parent <section>, so that the section's padding-bottom no longer leaks
 * below the wave (and padding-top no longer leaks above a top-wave).
 *
 * Any <section> that directly contains a .wave-divider is promoted to
 * position:relative via :has() so the absolute children anchor correctly.
 */
section:has(> .wave-divider) {
    position: relative;
}

.wave-divider {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    line-height: 0;
    pointer-events: none;
    display: block;
    z-index: 2;
}

.wave-divider--bottom {
    bottom: -1px;
}

.wave-divider--top {
    top: -1px;
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: 60px;
    vertical-align: bottom;
}

.wave-divider--top svg {
    transform: rotate(180deg);
}

@media (min-width: 768px) {
    .wave-divider svg {
        height: 80px;
    }
}

@media (min-width: 1280px) {
    .wave-divider svg {
        height: 100px;
    }
}

/* ── Liquid Glass Effect ────────────────────────────────────────────── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* ── Mega Menu Links ────────────────────────────────────────────────── */
.mega-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4375rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.15s ease;
}

.mega-link:hover {
    background: rgba(0, 0, 0, 0.025);
}

.mega-link-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

/* ── Portal Subnav scroll (hide scrollbar) ──────────────────────────── */
.portal-subnav-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.portal-subnav-scroll::-webkit-scrollbar {
    display: none;
}

/* ── Mobile Drawer Links ────────────────────────────────────────────── */
.mobile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    transition: all 0.15s ease;
}

.mobile-link:hover {
    background: rgba(0, 0, 0, 0.025);
}

.mobile-sub-link {
    display: block;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
    transition: all 0.15s ease;
}

.mobile-sub-link:hover {
    color: #1f2937;
    background: rgba(0, 0, 0, 0.025);
}

/* ── Product Pricing Cards ──────────────────────────────────────────── */
.pricing-card {
    position: relative;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pricing-card:hover {
    border-color: var(--brand);
    box-shadow:
        0 20px 60px rgba(52, 169, 128, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.04);
    transform: translateY(-4px);
}

.pricing-card:hover::before {
    opacity: 1;
}

.pricing-card.featured {
    border-color: var(--brand);
    box-shadow: 0 8px 40px rgba(52, 169, 128, 0.12);
}

.pricing-card.featured::before {
    opacity: 1;
}

/* ── Hero Background Blobs ──────────────────────────────────────────── */
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: blobFloat 20s ease-in-out infinite;
}

.hero-blob-1 {
    width: 600px;
    height: 600px;
    background: var(--brand-light);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.hero-blob-2 {
    width: 400px;
    height: 400px;
    background: #a8f2d1;
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.hero-blob-3 {
    width: 300px;
    height: 300px;
    background: #34d399;
    top: 50%;
    left: 40%;
    animation-delay: -14s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(10px, 10px) scale(1.02); }
}

/* ── Trustpilot Stars ───────────────────────────────────────────────── */
.trustpilot-stars {
    display: inline-flex;
    gap: 2px;
}

.trustpilot-stars i {
    color: #FFC107;
    font-size: 1.125rem;
}

/* ── Partner Logo Row ───────────────────────────────────────────────── */
.partner-logo {
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s ease;
    height: 28px;
    width: auto;
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* ── Feature Cards ──────────────────────────────────────────────────── */
.feature-card {
    background: white;
    border: 1px solid #f3f4f6;
    border-radius: 1.25rem;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    border-color: #e5e7eb;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.875rem;
    background: rgba(52, 169, 128, 0.08);
    color: var(--brand);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* ── Domain Search Input ────────────────────────────────────────────── */
.domain-search-input {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    transition: all 0.2s ease;
    outline: none;
}

.domain-search-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(52, 169, 128, 0.1);
}

/* ── Category Cards (product overview) ──────────────────────────────── */
.category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #f1ece4;
    border-radius: 1.5rem;
    padding: 2rem 1.75rem 1.75rem;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    transform: translateY(4px);
    transition: transform 0.35s ease;
}

.category-card:hover {
    border-color: rgba(249, 115, 22, 0.25);
    box-shadow:
        0 24px 60px rgba(52, 169, 128, 0.10),
        0 4px 12px rgba(249, 115, 22, 0.06);
    transform: translateY(-4px);
}

.category-card:hover::before {
    transform: translateY(0);
}

.category-card .icon-wrapper {
    width: 4.5rem;
    height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, rgba(52, 169, 128, 0.12), rgba(249, 115, 22, 0.12));
    color: var(--brand);
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
    transition: transform 0.35s ease;
}

.category-card:hover .icon-wrapper {
    transform: scale(1.05) rotate(-3deg);
}

.category-card .price-tag {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.category-card .price-tag strong {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-dark);
}

.category-card .cta-link {
    margin-top: auto;
    padding-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--brand);
    transition: gap 0.2s ease, color 0.2s ease;
}

.category-card:hover .cta-link {
    gap: 0.625rem;
    color: var(--brand-dark);
}

/* ── Guarantee Pills ────────────────────────────────────────────────── */
.guarantee-pill {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 1rem;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.06);
}

.guarantee-pill .icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(251, 146, 60, 0.18));
    color: var(--accent);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.guarantee-pill .label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
}

.guarantee-pill .sublabel {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

/* ── Tech Spec Cards ────────────────────────────────────────────────── */
.tech-spec-card {
    background: white;
    border: 1px solid #f1ece4;
    border-radius: 1.25rem;
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-spec-card:hover {
    border-color: rgba(52, 169, 128, 0.3);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.tech-spec-card .spec-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(52, 169, 128, 0.10), rgba(110, 231, 179, 0.10));
    color: var(--brand);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.tech-spec-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.tech-spec-card p {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.55;
}

/* ── Testimonial Cards ──────────────────────────────────────────────── */
.testimonial-card {
    background: white;
    border: 1px solid #f1ece4;
    border-radius: 1.5rem;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.testimonial-card .stars {
    display: inline-flex;
    gap: 2px;
    color: #fbbf24;
    font-size: 0.875rem;
}

.testimonial-card .quote {
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.6;
    flex-grow: 1;
}

.testimonial-card .author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.testimonial-card .avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.testimonial-card .author-info {
    line-height: 1.3;
}

.testimonial-card .author-info .name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
}

.testimonial-card .author-info .role {
    font-size: 0.75rem;
    color: #6b7280;
}

/* ── Feature Row (alternating) ──────────────────────────────────────── */
.feature-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
    padding: 2.5rem 0;
}

@media (min-width: 1024px) {
    .feature-row {
        grid-template-columns: 1fr 1fr;
        gap: 5rem;
        padding: 3.5rem 0;
    }

    .feature-row.is-reverse .feature-row__media {
        order: 1;
    }

    .feature-row.is-reverse .feature-row__content {
        order: 2;
    }
}

.feature-row__media {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(52, 169, 128, 0.08), rgba(249, 115, 22, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.feature-row__media .big-icon {
    font-size: 5rem;
    color: var(--brand);
    opacity: 0.85;
    filter: drop-shadow(0 12px 24px rgba(52, 169, 128, 0.18));
}

.feature-row__media::before,
.feature-row__media::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.5;
}

.feature-row__media::before {
    width: 180px;
    height: 180px;
    background: rgba(52, 169, 128, 0.35);
    top: -40px;
    left: -40px;
}

.feature-row__media::after {
    width: 140px;
    height: 140px;
    background: rgba(249, 115, 22, 0.3);
    bottom: -40px;
    right: -40px;
}

.feature-row__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent-dark);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.feature-row__title {
    font-size: 1.875rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 1rem;
}

@media (min-width: 1024px) {
    .feature-row__title {
        font-size: 2.25rem;
    }
}

.feature-row__text {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.65;
    margin-bottom: 1.25rem;
}

.feature-row__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--brand);
    font-weight: 700;
    font-size: 0.9375rem;
    transition: gap 0.2s ease, color 0.2s ease;
}

.feature-row__cta:hover {
    gap: 0.625rem;
    color: var(--brand-dark);
}

/* ── TLD Chip (homepage domain search) ──────────────────────────────── */
.tld-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #374151;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tld-chip:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}

.tld-chip .price {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
}

/* ── Smooth Scroll Offset for sticky header ─────────────────────────── */
html {
    scroll-padding-top: 5rem;
}

/* ── Selection Color ────────────────────────────────────────────────── */
::selection {
    background: rgba(52, 169, 128, 0.15);
    color: inherit;
}

/* ── Scrollbar (webkit) ─────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ── Checkout Step Connector ────────────────────────────────────────── */
.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ── Period Picker (hosting page) ───────────────────────────────────── */
.period-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem;
    border-radius: 9999px;
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ── Stripe Payment Element overrides ───────────────────────────────── */
#stripe-payment-element {
    min-height: 180px;
}

/* ── Icon wrapper ───────────────────────────────────────────────────── */
.icon-wrapper {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.875rem;
    background: rgba(52, 169, 128, 0.08);
}

/* ── Checkout option card active animation ──────────────────────────── */
[x-data] .border-brand {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
