/* ==========================================================================
   Premium Landing & Public Pages CSS (Facebook/LinkedIn Aesthetic)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Canonical brand palette (mirrors resources/asset/scss/_variables.scss &
       public/css/main.css). These were previously self-referential
       (`var(--brand-primary)`), which is a guaranteed-invalid value — every
       `var(--brand-primary)` on the public pages silently resolved to nothing,
       leaving e.g. the login "Sign In" button transparent. */
    --brand-primary: #00bfa5;
    --brand-secondary: #004182;
    --brand-success: #057642;
    --bg-light: #f3f2ef;
    --bg-white: #ffffff;
    --text-main: rgba(0, 0, 0, 0.9);
    --text-muted: rgba(0, 0, 0, 0.6);
    --border-color: rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* --- Public Navbar --- */
.public-navbar {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.public-navbar .navbar-brand img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.public-navbar .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

.public-navbar .nav-link:hover, .public-navbar .nav-link.active {
    color: var(--brand-primary);
}

.public-navbar .navbar-toggler {
    padding: 0.45rem 0.65rem !important;
    border-radius: 12px !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.public-navbar .navbar-toggler-icon {
    width: 1.4em !important;
    height: 1.4em !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230f172a' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.btn-brand {
    background-color: var(--brand-primary);
    color: #fff;
    border-radius: 24px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
}

.btn-brand:hover {
    background-color: var(--brand-secondary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.2);
}

.btn-brand-outline {
    background-color: transparent;
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
    border-radius: 24px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-brand-outline:hover {
    background-color: rgba(10, 102, 194, 0.05);
    color: var(--brand-secondary);
}

/* --- Hero Section --- */
.hero-section {
    padding: 6rem 0 4rem;
    background-color: var(--bg-white);
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #111827;
    margin-bottom: 1.5rem;
}

.hero-title span {
    color: var(--brand-primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 90%;
}

.hero-image {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.5s ease;
}

.hero-image:hover {
    transform: perspective(1000px) rotateY(0deg);
}

/* --- Features Section --- */
.features-section {
    padding: 5rem 0;
    background-color: var(--bg-light);
}

.feature-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.feature-icon {
    font-size: 2.5rem;
    color: var(--brand-primary);
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* --- Legal / Document Center Layout --- */
.doc-center-header {
    background-color: var(--brand-secondary);
    color: #fff;
    padding: 4rem 0 6rem;
    text-align: center;
}

.doc-center-header h1 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.doc-center-content {
    background: var(--bg-white);
    max-width: 800px;
    margin: -3rem auto 4rem;
    border-radius: 12px;
    padding: 3rem 4rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.doc-center-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.doc-center-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.doc-center-content p, .doc-center-content li {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.doc-center-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

/* --- Footer --- */
.public-footer {
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
}

.footer-heading {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin-bottom: 0.75rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--brand-primary);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-section {
        padding: 4rem 0;
        text-align: center;
    }
    .hero-image {
        margin-top: 3rem;
    }
    .doc-center-content {
        padding: 2rem 1.5rem;
        margin-top: -2rem;
    }
}

/* ==========================================================================
   Family Code Modal - Premium Glassmorphism Redesign
   ========================================================================== */
.glass-modal {
    display: none;
    z-index: 1050;
}
.glass-modal.is-active {
    display: flex;
}
.glass-overlay {
    background-color: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(8px);
}
.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 450px;
    width: 100%;
}
.logo-glow {
    filter: drop-shadow(0 4px 6px rgba(10, 102, 194, 0.2));
}
.premium-text {
    color: #1a202c !important;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

/* Floating Label Input */
.glass-input-wrapper {
    position: relative;
}
.glass-input {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 2px solid rgba(10, 102, 194, 0.2) !important;
    border-radius: 12px !important;
    padding: 1.75rem 1rem 0.75rem !important;
    font-size: 1.1rem !important;
    font-weight: 500;
    color: #2d3748 !important;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.glass-input:focus {
    border-color: var(--brand-primary) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.1) !important;
}
.glass-floating-label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: #718096;
    pointer-events: none;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-weight: 500;
}
.glass-input:focus ~ .glass-floating-label,
.glass-input:not(:placeholder-shown) ~ .glass-floating-label {
    top: 1rem;
    font-size: 0.75rem;
    color: var(--brand-primary);
    font-weight: 600;
}

/* Gradient Button */
.btn-gradient {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em;
    transition: all 0.3s ease !important;
}
.glow-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(10, 102, 194, 0.3);
}
.glow-effect:active {
    transform: translateY(0);
}

/* Code Output Area */
.code-output-wrapper {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 1rem;
    border: 1px dashed rgba(10, 102, 194, 0.3);
}
.code-addons {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.glass-code-input {
    background: #fff !important;
    border: 1px solid rgba(10, 102, 194, 0.1) !important;
    color: var(--brand-primary) !important;
    font-size: 1.25rem !important;
    letter-spacing: 0.1em;
}
.btn-coral-glow {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease !important;
}
.btn-coral-glow:hover {
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.4);
}

/* ==========================================================================
   Modern Back to Top Floating Action Button
   ========================================================================== */
.back-to-top-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 191, 165, 0.3);
    color: var(--brand-primary, #00bfa5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 191, 165, 0.2);
    cursor: pointer;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.85);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s ease,
                box-shadow 0.2s ease,
                border-color 0.2s ease;
    padding: 0;
    outline: none;
    touch-action: manipulation;
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
    background: var(--brand-primary, #00bfa5);
    color: #ffffff;
    border-color: var(--brand-primary, #00bfa5);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 12px 28px rgba(0, 191, 165, 0.35), 0 4px 10px rgba(0, 0, 0, 0.15);
}

.back-to-top-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 12px rgba(0, 191, 165, 0.25);
}

.back-to-top-btn:focus-visible {
    outline: 2px solid var(--brand-primary, #00bfa5);
    outline-offset: 3px;
}

.back-to-top-btn .back-to-top-icon {
    transition: transform 0.2s ease;
}

.back-to-top-btn:hover .back-to-top-icon {
    transform: translateY(-2px);
}

@media (max-width: 991.98px) {
    .back-to-top-btn {
        bottom: 84px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
}

[data-theme="dark"] .back-to-top-btn,
body.dark-mode .back-to-top-btn,
body.dark-theme .back-to-top-btn {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(0, 191, 165, 0.4);
    color: #00bfa5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 191, 165, 0.3);
}

[data-theme="dark"] .back-to-top-btn:hover,
body.dark-mode .back-to-top-btn:hover,
body.dark-theme .back-to-top-btn:hover {
    background: var(--brand-primary, #00bfa5);
    color: #ffffff;
}

