
/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Align card to bottom like reference */
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.login-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-content {
    width: 100%;
    max-width: 480px;
    padding: 40px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 40px; /* Highly rounded corners like reference */
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: slideUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

#login-particles-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.login-card-content {
    position: relative;
    z-index: 2;
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.login-header p {
    color: var(--secondary-color);
    font-size: 14px;
    margin: 0;
}

.full-width {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.secondary-btn {
    background: var(--glass-button-bg);
    border: 1px solid var(--glass-button-border);
    color: var(--glass-button-text);
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(9, 30, 66, 0.12);
    backdrop-filter: blur(calc(var(--glass-blur) - 2px)) saturate(140%);
    -webkit-backdrop-filter: blur(calc(var(--glass-blur) - 2px)) saturate(140%);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.secondary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(9, 30, 66, 0.14);
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(0, 86, 145, 0.20);
}

.secondary-btn:active {
    transform: translateY(0);
    box-shadow: 0 8px 18px rgba(9, 30, 66, 0.12);
}

.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.session-resume {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 18px 0 12px;
    padding: 14px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 28px rgba(9, 30, 66, 0.10);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.session-chip {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(0, 86, 145, 0.12);
    border: 1px solid rgba(0, 86, 145, 0.18);
    color: rgba(0, 86, 145, 0.95);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.6px;
}

.session-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.session-title {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.session-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.session-switch-link {
    padding-top: 2px;
    font-weight: 600;
}

.google-btn {
    background-color: rgba(255, 255, 255, 0.8) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

.google-btn:hover {
    background-color: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

.separator {
    text-align: center;
    color: var(--text-secondary);
    margin: 15px 0;
    font-size: 14px;
    position: relative;
}

.separator::before, .separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--border-color);
}

.separator::before { left: 0; }
.separator::after { right: 0; }

.arrow {
    font-size: 18px;
    transition: transform 0.2s;
}

.primary-btn:hover .arrow {
    transform: translateX(4px);
}

.register-only {
    display: none;
}

.login-form.register-mode .register-only {
    display: block;
}

.login-form.session-hidden {
    display: none;
}

.login-form.reset-mode .reset-hidden {
    display: none;
}

.login-form.reset-mode #new-btn-forgot {
    display: none;
}

.reset-only {
    display: none;
}

.login-form.reset-mode .reset-only {
    display: block;
}

.link-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    padding: 6px 0 0;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
}

.link-btn:hover {
    text-decoration: underline;
}

.error-message {
    border-radius: 10px;
    padding: 8px 10px;
}

.error-message.is-error {
    background: rgba(255, 59, 48, 0.12);
    color: #cc2b23;
}

.error-message.is-success {
    background: rgba(52, 199, 89, 0.12);
    color: #1f8f3a;
}

.welcome-screen {
    position: fixed;
    inset: 0;
    background: #e8f1fb;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
    overflow: hidden;
}

.welcome-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#welcome-particles-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.welcome-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: #0a5fa0;
    animation: welcomePop 0.5s ease-out;
    text-align: center;
    padding: 0 24px;
    max-width: min(90vw, 420px);
}

.welcome-icon {
    width: clamp(60px, 14vw, 76px);
    height: clamp(60px, 14vw, 76px);
    border-radius: 50%;
    background: #0a5fa0;
    color: white;
    font-size: clamp(26px, 6vw, 34px);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-title {
    font-size: clamp(18px, 4.4vw, 22px);
    font-weight: 600;
}

.welcome-name {
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 700;
}

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

@media (max-width: 480px) {
    .login-content {
        padding: 16px;
        max-width: 520px;
    }

    .login-card {
        border-radius: 28px;
        padding: 20px;
    }
}

@media (max-height: 700px) {
    .login-content {
        height: auto;
        min-height: 100%;
        justify-content: flex-end;
    }
}
