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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #080C14;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow: hidden;
    color: #E8ECF1;
}

body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
}

body::before {
    width: 400px;
    height: 400px;
    background: #E8C87A;
    top: -120px;
    right: -120px;
}

body::after {
    width: 350px;
    height: 350px;
    background: #6B9BD8;
    bottom: -100px;
    left: -100px;
}

.login-container,
.invite-container {
    background: #111827;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 420px;
    width: 90%;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(232,200,122,0.12);
}

.logo {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
}

.logo-icon-box {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #E8C87A 0%, #6B9BD8 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1 {
    font-family: 'Urbanist', sans-serif;
    color: #E8ECF1;
    margin-bottom: 0.5rem;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: rgba(232,236,241,0.38);
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.company-name {
    font-weight: 600;
    color: #E8C87A;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(232,200,122,0.20);
    padding: 0.75rem 1.75rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #E8ECF1;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
    font-family: inherit;
    min-height: 3rem;
}

.google-btn:hover {
    border-color: #E8C87A;
    background: rgba(232,200,122,0.10);
    box-shadow: 0 4px 16px rgba(232,200,122,0.15);
    transform: translateY(-1px);
}

.google-btn:active {
    transform: scale(0.98);
}

.google-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.error-message {
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    border: 1px solid rgba(239,68,68,0.25);
}

.info-message {
    background: rgba(59,130,246,0.12);
    color: #93c5fd;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    border: 1px solid rgba(59,130,246,0.25);
}

.setup-notice {
    background: rgba(245,158,11,0.12);
    color: #fcd34d;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    border: 1px solid rgba(245,158,11,0.25);
}

.features {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.features h3 {
    font-family: 'Urbanist', sans-serif;
    color: rgba(232,236,241,0.38);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    transition: all 0.2s;
}

.feature-card:hover {
    background: rgba(232,200,122,0.08);
}

.feature-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-card-icon.voice {
    background: linear-gradient(135deg, #E8C87A, #D4B56A);
}

.feature-card-icon.search {
    background: linear-gradient(135deg, #6B9BD8, #3b82f6);
}

.feature-card-icon.analytics {
    background: linear-gradient(135deg, #a855f7, #ec4899);
}

.feature-card-label {
    font-family: 'Urbanist', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(232,236,241,0.65);
}

.login-link {
    display: inline-block;
    margin-top: 1.25rem;
    color: #E8C87A;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 2.75rem;
    line-height: 2.75rem;
}

.login-link:hover {
    text-decoration: underline;
    color: #D4B56A;
}

.login-footnote {
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: rgba(232,236,241,0.38);
}

.login-footnote a {
    color: rgba(232,236,241,0.65);
    text-decoration: none;
}

.login-footnote a:hover {
    color: #E8C87A;
    text-decoration: underline;
}

/* Legal modal */
.legal-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.legal-modal-overlay.active {
    display: flex;
}

.legal-modal {
    background: #111827;
    border: 1px solid rgba(232,200,122,0.12);
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: legalFadeIn 0.2s ease;
}

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

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.legal-modal-header h2 {
    font-family: 'Urbanist', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #E8ECF1;
}

.legal-modal-close {
    background: none;
    border: none;
    color: rgba(232,236,241,0.38);
    font-size: 1.5rem;
    cursor: pointer;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s;
}

.legal-modal-close:hover {
    background: rgba(255,255,255,0.08);
    color: #E8ECF1;
}

.legal-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: rgba(232,236,241,0.65);
}

.legal-modal-body h3 {
    font-family: 'Urbanist', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #E8ECF1;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.legal-modal-body h3:first-child {
    margin-top: 0;
}

.legal-modal-body p {
    margin-bottom: 0.75rem;
}

.legal-modal-body ul {
    margin: 0 0 0.75rem 1.25rem;
}

.legal-modal-body li {
    margin-bottom: 4px;
}

.legal-modal-body strong {
    color: rgba(232,236,241,0.85);
}

.state-valid,
.state-error {
    display: none;
}

/* Mobile: bottom-sheet modal */
@media (max-width: 768px) {
    .legal-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .legal-modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        animation: legalSlideUp 0.3s ease;
    }

    @keyframes legalSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .legal-modal-body {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding: 1.5rem 0;
        overflow-y: auto;
    }

    .login-container,
    .invite-container {
        width: 94%;
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
        margin-top: 1rem;
    }

    h1 {
        font-size: 1.25rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .feature-card {
        flex-direction: row;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .feature-card-icon {
        width: 2.5rem;
        height: 2.5rem;
        flex-shrink: 0;
    }

    /* iOS input zoom prevention */
    input, select, textarea {
        font-size: 1rem !important;
    }

    .google-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 600px) and (min-width: 481px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}
