/* ==========================================================================
   BIOLAB HEALTHCARE LANDING PAGE DESIGN SYSTEM
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
    /* Brand Colors */
    --color-primary: #00853e; /* Cartellina Green */
    --color-primary-rgb: 0, 133, 62;
    --color-primary-hover: #006a31;
    --color-primary-light: #edf7f1;
    --color-primary-light-rgb: 237, 247, 241;
    
    /* Functional Colors */
    --color-bg-page: #f3faf6;
    --color-text-title: #0e291a;
    --color-text-body: #475f51;
    --color-text-muted: #728c7e;
    --color-white: #ffffff;
    --color-error: #d32f2f;
    --color-error-light: #ffebee;
    --color-border-input: #cfdfd6;
    
    /* Typography */
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    --font-headings: 'Outfit', sans-serif;
    
    /* Spacing & Layout */
    --transition-speed: 0.3s;
    --transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Premium Shadows & Borders */
    --shadow-card: 
        0 4px 6px -1px rgba(0, 85, 30, 0.05),
        0 20px 40px -4px rgba(0, 85, 30, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    --shadow-button:
        0 4px 14px rgba(0, 133, 62, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-button-hover:
        0 6px 20px rgba(0, 133, 62, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.08);
    --border-glass: 1px solid rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: var(--font-primary);
    background-color: var(--color-bg-page);
    color: var(--color-text-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

/* ==========================================================================
   AMBIENT BACKGROUND (ANIMATED BLOBS)
   ========================================================================== */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    mix-blend-mode: multiply;
    animation: float 25s infinite ease-in-out alternate;
}

.bubble-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background-color: rgba(var(--color-primary-rgb), 0.3);
    animation-duration: 20s;
}

.bubble-2 {
    bottom: -15%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background-color: rgba(19, 147, 86, 0.25);
    animation-duration: 28s;
    animation-delay: -5s;
}

.bubble-3 {
    top: 40%;
    left: 50%;
    width: 35vw;
    height: 35vw;
    background-color: rgba(156, 199, 173, 0.4);
    animation-duration: 24s;
    animation-delay: -2s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    33% {
        transform: translate(8%, 10%) scale(1.1) rotate(120deg);
    }
    66% {
        transform: translate(-5%, 15%) scale(0.9) rotate(240deg);
    }
    100% {
        transform: translate(0, 0) scale(1) rotate(360deg);
    }
}

/* ==========================================================================
   PAGE LAYOUT
   ========================================================================== */
.page-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 2rem 1.5rem;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 3rem 0;
}

/* ==========================================================================
   GLASSMORPHISM MAIN CARD
   ========================================================================== */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--border-glass);
    border-radius: 28px;
    padding: 3.5rem 3rem;
    max-width: 640px;
    width: 100%;
    box-shadow: var(--shadow-card);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Subtle border glow effect */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

.logo-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-logo {
    max-width: 260px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.03));
}

/* Status Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2.2rem;
    border: 1px solid rgba(var(--color-primary-rgb), 0.15);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    position: relative;
}

.badge-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: var(--color-primary);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

/* Typography styles */
.main-title {
    font-family: var(--font-headings);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-title);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.highlight-text {
    color: var(--color-primary);
    position: relative;
    display: inline-block;
}

.portal-development-text {
    font-size: clamp(0.85rem, 1.5vw, 0.925rem);
    line-height: 1.5;
    color: var(--color-text-muted);
    max-width: 480px;
    margin-bottom: 1.5rem;
}

.cta-invite {
    font-family: var(--font-headings);
    font-size: clamp(1.05rem, 1.8vw, 1.225rem);
    font-weight: 600;
    line-height: 1.45;
    color: var(--color-text-title);
    max-width: 520px;
    margin-bottom: 1.75rem;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.95rem 1.8rem;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-spring);
    position: relative;
    outline: none;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-button);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-button-hover);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Contact CTA Bar & Custom Buttons */
.contact-ctas {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 520px;
    margin-bottom: 0.5rem;
    z-index: 2;
}

.btn-cta {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-spring);
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.btn-cta-call {
    background-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: var(--shadow-button);
}

.btn-cta-call:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-button-hover);
}

.btn-cta-wa {
    background-color: #25d366;
    color: var(--color-white);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.2);
}

.btn-cta-wa:hover {
    background-color: #1ebe57;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.btn-cta-email {
    background-color: #0b5aa5;
    color: var(--color-white);
    box-shadow: 0 4px 14px rgba(11, 90, 165, 0.2);
}

.btn-cta-email:hover {
    background-color: #054a8a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 90, 165, 0.3);
}

.btn-cta:active {
    transform: translateY(1px);
}

.cta-icon {
    width: 18px;
    height: 18px;
}

/* Secondary Actions Wrapper */
.secondary-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
    z-index: 2;
}

/* Translucent Subtle Login Button */
.btn-login-subtle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-primary);
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background-color: rgba(var(--color-primary-rgb), 0.05);
    border: 1px solid rgba(var(--color-primary-rgb), 0.16);
    color: var(--color-primary);
    border-radius: 9px;
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-spring);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    outline: none;
}

.btn-login-subtle:hover {
    background-color: rgba(var(--color-primary-rgb), 0.12);
    border-color: rgba(var(--color-primary-rgb), 0.32);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.08);
}

.btn-login-subtle:active {
    transform: translateY(0);
}

.btn-icon-sm {
    width: 13px;
    height: 13px;
}

/* Micro animations */
.fade-in {
    animation: fadeIn 0.8s var(--transition-spring) forwards;
}

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

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    width: 100%;
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(var(--color-primary-rgb), 0.08);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.footer-info {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.footer-link {
    color: var(--color-text-body);
    font-weight: 500;
    border-bottom: 1px dashed rgba(var(--color-primary-rgb), 0.25);
    padding-bottom: 1px;
}

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

.footer-credits {
    font-size: 0.825rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.credits-link {
    color: var(--color-primary);
    font-weight: 600;
    transition: opacity var(--transition-speed) ease;
}

.credits-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ==========================================================================
   RESTRICTED ACCESS NATIVE MODAL
   ========================================================================== */
.login-modal {
    position: fixed;
    inset: 0;
    margin: auto;
    border: var(--border-glass);
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: var(--border-radius-lg);
    box-shadow: 
        0 10px 25px -5px rgba(0, 85, 30, 0.05),
        0 25px 50px -12px rgba(0, 85, 30, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    padding: 2.5rem;
    width: calc(100% - 2rem);
    max-width: 460px;
    z-index: 100;
    
    /* Native transitions configuration */
    opacity: 0;
    transform: scale(0.95);
    transition: 
        opacity 0.3s ease, 
        transform 0.35s var(--transition-spring), 
        display 0.35s allow-discrete, 
        overlay 0.35s allow-discrete;
}

/* Open State */
.login-modal[open] {
    opacity: 1;
    transform: scale(1);
    
    /* Trigger entry starting state */
    @starting-style {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Modal Backdrop */
.login-modal::backdrop {
    background-color: rgba(10, 29, 18, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: 
        background-color 0.35s ease, 
        backdrop-filter 0.35s ease,
        display 0.35s allow-discrete,
        overlay 0.35s allow-discrete;
}

.login-modal[open]::backdrop {
    background-color: rgba(10, 29, 18, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    @starting-style {
        background-color: rgba(10, 29, 18, 0);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
}

/* Modal Internal Elements */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.modal-title {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-title);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-title-icon {
    width: 22px;
    height: 22px;
    color: var(--color-primary);
}

.btn-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.btn-close:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.btn-close svg {
    width: 20px;
    height: 20px;
}

.modal-desc {
    font-size: 0.925rem;
    line-height: 1.5;
    color: var(--color-text-body);
    margin-bottom: 2rem;
}

/* Form controls */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-title);
    padding-left: 0.25rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color var(--transition-speed) ease;
}

.form-input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.75rem;
    border: 1px solid var(--color-border-input);
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--color-text-title);
    background-color: rgba(255, 255, 255, 0.7);
    outline: none;
    transition: all var(--transition-speed) ease;
}

.form-input::placeholder {
    color: #abbcb2;
}

.form-input:focus {
    border-color: var(--color-primary);
    background-color: var(--color-white);
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.1);
}

.form-input:focus + .input-icon {
    color: var(--color-primary);
}

/* Validation Feedback & Alert states */
.form-feedback {
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all var(--transition-speed) ease;
}

.form-feedback.error {
    background-color: var(--color-error-light);
    color: var(--color-error);
    border: 1px solid rgba(211, 47, 47, 0.2);
    padding: 0.75rem 1rem;
}

.form-feedback.success {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    padding: 0.75rem 1rem;
}

/* Submit button loader */
.btn-submit {
    width: 100%;
    margin-top: 0.5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-white);
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

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

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
    .bubble,
    .btn-primary:hover,
    .badge-dot::after {
        animation: none;
    }
    
    .login-modal,
    .login-modal::backdrop,
    .card,
    .btn,
    .form-input {
        transition: none !important;
        transform: none !important;
    }
    
    .login-modal[open] {
        @starting-style {
            transform: none !important;
        }
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 600px) {
    .page-wrapper {
        padding: 1.5rem 1rem;
    }
    
    .main-content {
        margin: 2rem 0;
    }
    
    .card {
        padding: 3rem 1.5rem 2.5rem 1.5rem;
        border-radius: 20px;
    }
    
    .brand-logo {
        max-width: 200px;
    }

    
    .badge {
        margin-bottom: 1.75rem;
    }
    
    .main-title {
        margin-bottom: 1rem;
    }
    
    .portal-development-text {
        margin-bottom: 1.25rem;
    }
    
    .cta-invite {
        margin-bottom: 1.5rem;
    }
    
    .contact-ctas {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .btn-cta {
        width: 100%;
        padding: 0.95rem 1.25rem;
    }
    
    .login-modal {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
}

@media (max-width: 400px) {
    .footer-info {
        font-size: 0.8rem;
    }
}
