body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', Arial, sans-serif;
    background: #f4f6fb;
    color: #222;
}
.centered-bg {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container, .projects-container, .editor-container {
    background: #fff;
    padding: 2.5rem 2rem 2rem;
    border-radius: 14px;
    box-shadow: 0 2px 32px rgba(60,72,101,0.09);
    min-width: 320px;
    max-width: 370px;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="text"], input[type="password"] {
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    outline: none;
    background: #f8fafc;
    transition: border-color 0.2s;
}
input:focus {
    border-color: #3b82f6;
}

button {
    background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
button:hover {
    background: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%);
}

.signup-link {
    margin-top: 1.4rem;
    text-align: center;
    font-size: 0.97rem;
}
.signup-link button {
    background: none;
    color: #3b82f6;
    padding: 0;
    margin-left: 0.4rem;
    font-weight: 600;
    box-shadow: none;
    border: none;
    cursor: pointer;
}

#login-error, #signup-error {
    color: #ef4444;
    margin-top: 0.2rem;
    min-height: 1.2em;
    font-size: 0.97em;
}

.projects-container, .editor-container {
    max-width: 900px;
    min-width: 380px;
    padding: 2.5rem;
}

@media (max-width: 600px) {
    .login-container, .projects-container, .editor-container {
        min-width: unset;
        max-width: 99vw;
        padding: 1.2rem;
    }
    h1 {
        font-size: 1.35rem;
    }
}

/* Popup styles */
#popup-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 1000;
    pointer-events: none;
}
.custom-popup {
    position: fixed;
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    background: rgba(36,41,64,0.37);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    z-index: 10001;
}
.popup-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(60,72,101,0.17);
    min-width: 330px;
    max-width: 95vw;
    padding: 2em 1.4em 1.3em 1.4em;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    animation: popupIn 0.14s;
}
@keyframes popupIn {
    from { transform: scale(0.97); opacity: 0;}
    to   { transform: scale(1); opacity: 1;}
}
.popup-content h2 {
    margin-top: 0;
    font-size: 1.25em;
    font-weight: 700;
    color: #3b82f6;
    text-align: left;
    margin-bottom: 0.7em;
}
.popup-message {
    margin-bottom: 1.2em;
    color: #222;
    font-size: 1.07em;
    text-align: left;
}
.popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.7em;
}
.popup-buttons button {
    font-size: 1em;
    border-radius: 7px;
    padding: 0.5em 1.2em;
    font-weight: 600;
    border: none;
    background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 1px 5px rgba(35,35,60,0.07);
    cursor: pointer;
    transition: background 0.17s;
}
.popup-buttons .popup-cancel {
    background: #e5e7eb;
    color: #374151;
}
.popup-buttons .popup-confirm:active,
.popup-buttons .popup-cancel:active {
    transform: scale(0.97);
}

input[type="text"], input[type="password"], input[type="email"] {
    border: 1px solid #e3e8f0;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    outline: none;
    background: #f8fafc;
    transition: border-color 0.2s;
}