/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Sorta Brand Colors */
    --color-navy: #000054;
    --color-blue: #2740fc;
    --color-sky: #66bdff;
    --color-mid-blue: #2886f9;
    --color-teal: #02e3d3;
    --color-lavender: #d1e4ff;
    --color-periwinkle: #99bdff;
    --color-ice: #c7e7ff;
    --color-baby-blue: #96d3ff;
    --color-mint: #ccf9f6;
    --color-white: #ffffff;
    --font: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    color: var(--color-navy);
    height: 100vh;
    background: linear-gradient(135deg, var(--color-lavender) 0%, var(--color-ice) 25%, var(--color-mint) 50%, var(--color-lavender) 75%, var(--color-ice) 100%);
    overflow: hidden;
}

/* Page Wrapper - Glassmorphism Card */
.page-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 20px auto;
    height: calc(100vh - 40px);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Particle Canvas */
#particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Navigation */
.navbar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.nav-linkedin {
    position: absolute;
    right: 40px;
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.nav-linkedin:hover {
    opacity: 1;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-navy);
    letter-spacing: -0.02em;
}

/* Hero Section */
.hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 40px 20px;
    flex: 1;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 84, 0.1);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-navy);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

/* Title */
.hero-title {
    font-size: 3.5rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--color-navy);
    margin-bottom: 16px;
}

.hero-title .highlight {
    color: var(--color-blue);
}

/* Subtitle */
.hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-navy);
    opacity: 0.65;
    margin-bottom: 24px;
    max-width: 600px;
}

/* Email Form */
.email-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid var(--color-navy);
    border-radius: 60px;
    padding: 6px 6px 6px 28px;
    width: 100%;
    max-width: 520px;
    margin-bottom: 0;
    transition: box-shadow 0.3s, border-color 0.3s;
}

.email-form:focus-within {
    box-shadow: 0 0 0 4px rgba(39, 64, 252, 0.15);
    border-color: var(--color-blue);
}

.email-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 1rem;
    color: var(--color-navy);
    outline: none;
}

.email-input::placeholder {
    color: var(--color-navy);
    opacity: 0.4;
}

.btn-join {
    flex-shrink: 0;
    padding: 14px 32px;
    background: var(--color-navy);
    color: var(--color-white);
    border: none;
    border-radius: 50px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-join:hover {
    background: var(--color-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(39, 64, 252, 0.3);
}

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

/* Form Stack Animation
   Story: 1 form typing → splits into 3 filled → stacks & sends
   Total cycle: 6s
   0–15%    Single form, lines fill in one by one
   15–20%   Pause with filled form
   20–45%   Form splits into 3 (left, center, right) with checks appearing
   45–65%   Pause showing 3 filled forms
   65–80%   Forms collapse back into a stack
   80–90%   Stack slides up and fades (sent)
   90–100%  Reset / pause before loop
*/

.form-stack {
    position: relative;
    width: 360px;
    height: 160px;
    margin-top: 20px;
    flex-shrink: 0;
}

.form-card {
    position: absolute;
    width: 200px;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    background: var(--color-white);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 84, 0.08);
    border: 1px solid rgba(0, 0, 84, 0.06);
}

/* Origin card — center, always starts visible */
.form-card.card-origin {
    z-index: 3;
    animation: originCard 6s ease-in-out infinite;
}

/* Left duplicate */
.form-card.card-left {
    z-index: 2;
    opacity: 0;
    animation: splitLeft 6s ease-in-out infinite;
}

/* Right duplicate */
.form-card.card-right {
    z-index: 2;
    opacity: 0;
    animation: splitRight 6s ease-in-out infinite;
}

.form-card-bar {
    width: 40%;
    height: 8px;
    background: var(--color-blue);
    border-radius: 4px;
    margin-bottom: 14px;
    opacity: 0.8;
}

.form-card-bar.bar-teal {
    background: var(--color-teal);
}

.form-card-bar.bar-sky {
    background: var(--color-sky);
}

.form-card-line {
    height: 6px;
    background: var(--color-lavender);
    border-radius: 3px;
    margin-bottom: 8px;
}

.form-card-line:last-of-type {
    margin-bottom: 0;
}

.form-card-line.w80 { width: 80%; }
.form-card-line.w65 { width: 65%; }
.form-card-line.w55 { width: 55%; }

/* Lines that animate filling in on origin card */
.card-origin .line-fill {
    animation: lineFill 6s ease-in-out infinite;
}

.card-origin .line-fill:nth-child(2) {
    animation-delay: 0s;
}

.card-origin .line-fill:nth-child(3) {
    animation-delay: 0.3s;
}

.card-origin .line-fill:nth-child(4) {
    animation-delay: 0.6s;
}

/* Filled lines on duplicate cards */
.line-filled {
    background: var(--color-periwinkle);
}

.form-card-check {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 24px;
    height: 24px;
    background: rgba(2, 227, 211, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    animation: checkPop 6s ease-in-out infinite;
}

/* Send indicator */
.send-indicator {
    position: absolute;
    left: 50%;
    bottom: 50px;
    transform: translateX(-50%) scale(0);
    opacity: 0;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: rgba(39, 64, 252, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sendPulse 6s ease-in-out infinite;
}

/* === KEYFRAMES === */

/* Lines fill in: empty → colored */
@keyframes lineFill {
    0%, 2%   { background: var(--color-lavender); width: 0%; }
    10%, 100% { background: var(--color-periwinkle); }
    5%       { width: 40%; }
    12%      { width: 80%; }
}

/* Origin: center → shrinks slightly during split → stacks → sends up → resets */
@keyframes originCard {
    0%       { transform: translateX(-50%) scale(1); opacity: 1; }
    20%      { transform: translateX(-50%) scale(1); opacity: 1; }
    /* Split phase — origin stays center */
    35%      { transform: translateX(-50%) scale(0.95); opacity: 1; }
    50%      { transform: translateX(-50%) scale(0.95); opacity: 1; }
    /* Collapse into stack */
    65%      { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
    /* Send up */
    78%      { transform: translateX(-50%) scale(0.9) translateY(-30px); opacity: 0; }
    79%, 95% { transform: translateX(-50%) scale(0.8); opacity: 0; }
    /* Reset */
    100%     { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Left card: invisible → appears and moves left → collapses back → sends */
@keyframes splitLeft {
    0%, 20%  { transform: translateX(-50%) scale(0.9); opacity: 0; }
    35%      { transform: translateX(-130%) scale(0.92); opacity: 1; }
    50%      { transform: translateX(-130%) scale(0.92); opacity: 1; }
    /* Collapse behind origin */
    65%      { transform: translateX(-55%) scale(0.93) translateY(8px); opacity: 0.7; }
    /* Send up */
    78%      { transform: translateX(-55%) scale(0.85) translateY(-25px); opacity: 0; }
    79%, 100% { opacity: 0; }
}

/* Right card: invisible → appears and moves right → collapses back → sends */
@keyframes splitRight {
    0%, 20%  { transform: translateX(-50%) scale(0.9); opacity: 0; }
    35%      { transform: translateX(30%) scale(0.92); opacity: 1; }
    50%      { transform: translateX(30%) scale(0.92); opacity: 1; }
    /* Collapse behind origin */
    65%      { transform: translateX(-45%) scale(0.90) translateY(16px); opacity: 0.5; }
    /* Send up */
    78%      { transform: translateX(-45%) scale(0.82) translateY(-20px); opacity: 0; }
    79%, 100% { opacity: 0; }
}

/* Checkmarks appear after split */
@keyframes checkPop {
    0%, 32%  { transform: scale(0); opacity: 0; }
    40%      { transform: scale(1.15); opacity: 1; }
    50%, 60% { transform: scale(1); opacity: 1; }
    70%      { transform: scale(1); opacity: 0; }
    100%     { transform: scale(0); opacity: 0; }
}

/* Send arrow appears during send phase */
@keyframes sendPulse {
    0%, 62%  { transform: translateX(-50%) scale(0); opacity: 0; }
    70%      { transform: translateX(-50%) scale(1); opacity: 1; }
    78%      { transform: translateX(-50%) scale(1) translateY(-40px); opacity: 0; }
    79%, 100% { transform: translateX(-50%) scale(0); opacity: 0; }
}

/* Success Overlay */
.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.success-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.success-content {
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.success-overlay.active .success-content {
    transform: translateY(0);
}

.success-content h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 20px 0 8px;
    color: var(--color-navy);
}

.success-content p {
    font-size: 1.1rem;
    opacity: 0.6;
    color: var(--color-navy);
}

/* ========== Admin Panel ========== */
.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 84, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.admin-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.admin-panel {
    background: var(--color-white);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 84, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.admin-overlay.active .admin-panel {
    transform: translateY(0);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid #eee;
}

.admin-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-navy);
}

.admin-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-navy);
    transition: background 0.2s;
}

.admin-close:hover {
    background: #e0e0e0;
}

.admin-stats {
    display: flex;
    gap: 16px;
    padding: 20px 28px;
}

.stat-card {
    flex: 1;
    background: linear-gradient(135deg, var(--color-lavender), var(--color-ice));
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-navy);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-navy);
    opacity: 0.6;
}

.admin-actions {
    display: flex;
    gap: 10px;
    padding: 0 28px 16px;
}

.admin-btn {
    padding: 8px 18px;
    border: 1px solid var(--color-navy);
    background: transparent;
    color: var(--color-navy);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.admin-btn:hover {
    background: var(--color-navy);
    color: var(--color-white);
}

.admin-btn.danger {
    border-color: #e74c3c;
    color: #e74c3c;
}

.admin-btn.danger:hover {
    background: #e74c3c;
    color: var(--color-white);
}

.admin-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 28px 24px;
}

.empty-state {
    text-align: center;
    padding: 32px 0;
    color: var(--color-navy);
    opacity: 0.4;
    font-size: 0.9rem;
}

.signup-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.signup-entry:last-child {
    border-bottom: none;
}

.signup-email {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-navy);
}

.signup-date {
    font-size: 0.75rem;
    color: var(--color-navy);
    opacity: 0.4;
}

/* Responsive */
@media (max-width: 768px) {
    .page-wrapper {
        margin: 10px;
        height: calc(100vh - 20px);
        border-radius: 16px;
    }

    .navbar {
        padding: 14px 20px;
    }

    .nav-linkedin {
        right: 20px;
    }

    .hero {
        padding: 20px 24px 16px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .email-form {
        padding: 4px 4px 4px 20px;
        max-width: 100%;
    }

    .btn-join {
        padding: 12px 20px;
        font-size: 0.875rem;
    }

    .form-stack {
        width: 280px;
        height: 130px;
    }

    .form-card {
        width: 150px;
        padding: 12px 14px;
    }

    .admin-panel {
        width: 95%;
        max-height: 85vh;
    }

    .admin-stats {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .badge {
        margin-bottom: 14px;
    }

    .email-form {
        flex-direction: column;
        border-radius: 20px;
        padding: 4px;
        gap: 4px;
    }

    .email-input {
        width: 100%;
        padding: 12px 20px;
        text-align: center;
    }

    .btn-join {
        width: 100%;
        border-radius: 16px;
    }

    .form-stack {
        width: 240px;
        height: 120px;
    }

    .form-card {
        width: 130px;
        padding: 10px 12px;
    }
}
