/* Login Page - dark blue palette (#2f4550, #f5f3ee) */

:root {
    --login-blue: #2f4550;
    --login-cream: #f5f3ee;
}

body.login-page {
    font-family: "Assistant", system-ui, sans-serif;
    background: var(--login-blue) !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    color: var(--login-cream) !important;
}

body.login-page .content {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Floating musical notes (created by login.js) */
body.login-page .login-floating-notes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

body.login-page .login-floating-note {
    position: absolute;
    color: rgba(245, 243, 238, 0.4);
    font-size: 2rem;
    animation: loginNoteFloat 15s linear infinite;
}

@keyframes loginNoteFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

body.login-page .login-floating-note:nth-child(1) { left: 8%; animation-delay: 0s; }
body.login-page .login-floating-note:nth-child(2) { left: 18%; animation-delay: 2s; }
body.login-page .login-floating-note:nth-child(3) { left: 28%; animation-delay: 4s; }
body.login-page .login-floating-note:nth-child(4) { left: 42%; animation-delay: 1s; }
body.login-page .login-floating-note:nth-child(5) { left: 55%; animation-delay: 6s; }
body.login-page .login-floating-note:nth-child(6) { left: 68%; animation-delay: 3s; }
body.login-page .login-floating-note:nth-child(7) { left: 78%; animation-delay: 8s; }
body.login-page .login-floating-note:nth-child(8) { left: 88%; animation-delay: 5s; }

/* Main login container */
.login-container {
    display: flex;
    width: 90vw;
    max-width: 1200px;
    height: 80vh;
    min-height: 600px;
    background: transparent;
    border-radius: 24px;
    border: 1px solid rgba(245, 243, 238, 0.18);
    box-shadow: none;
    overflow: hidden;
    position: relative;
    z-index: 2;
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Left panel - Branding */
.login-brand-panel {
    flex: 1;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
    border-left: 1px solid rgba(245, 243, 238, 0.18);
}

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

.brand-title {
    font-family: "Assistant", sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--login-cream);
    margin-bottom: 15px;
}

.brand-subtitle {
    font-family: "Assistant", sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--login-cream);
    opacity: 0.85;
    line-height: 1.6;
    max-width: 350px;
}

.brand-features {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.brand-feature {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--login-cream);
    font-family: "Assistant", sans-serif;
    font-weight: 400;
    font-size: 1rem;
}

/* Right panel - Login form */
.login-form-panel {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background: transparent;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-title {
    font-family: "Assistant", sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--login-cream);
    margin-bottom: 10px;
}

.form-subtitle {
    font-family: "Assistant", sans-serif;
    color: var(--login-cream);
    opacity: 0.85;
    font-size: 1rem;
    font-weight: 400;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 30px;
}

.flash-message {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-weight: 500;
    font-family: "Assistant", sans-serif;
    animation: slideInRight 0.5s ease-out;
}

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

.flash-message.success {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    color: #2e7d32;
}

.flash-message.error {
    background: #ffebee;
    border: 2px solid #e57373;
    color: #c62828;
}

.flash-message.warning {
    background: #fff8e1;
    border: 2px solid #ffb74d;
    color: #e65100;
}

.flash-message.info {
    background: #e3f2fd;
    border: 2px solid #64b5f6;
    color: #1565c0;
}

/* Form styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    font-family: "Assistant", sans-serif;
    font-weight: 600;
    color: var(--login-cream);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(245, 243, 238, 0.45);
    border-radius: 12px;
    font-size: 1rem;
    font-family: "Assistant", sans-serif;
    font-weight: 400;
    color: var(--login-blue);
    background: var(--login-cream);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    outline: none;
    border-color: var(--login-cream);
    box-shadow: 0 0 0 4px rgba(245, 243, 238, 0.18);
}

.form-input:hover {
    border-color: rgba(245, 243, 238, 0.75);
}

.form-input::placeholder {
    color: rgba(47, 69, 80, 0.55);
}

.remember-me-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(245, 243, 238, 0.22);
    border-radius: 12px;
    background: rgba(245, 243, 238, 0.08);
    color: var(--login-cream);
    cursor: pointer;
}

.remember-me-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--login-cream);
    cursor: pointer;
}

.remember-me-option span {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.4;
}

.remember-me-option small {
    opacity: 0.75;
}

/* Submit button */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--login-cream) !important;
    color: var(--login-blue) !important;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: "Assistant", sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.submit-btn:hover:not(:disabled) {
    background: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.submit-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(47, 69, 80, 0.3);
    border-top: 2px solid var(--login-blue);
    border-radius: 50%;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Register link */
.register-link {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(245, 243, 238, 0.18);
}

.register-link p {
    font-family: "Assistant", sans-serif;
    color: var(--login-cream);
    opacity: 0.85;
    margin-bottom: 15px;
}

.register-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--login-cream) !important;
    border: none;
    border-radius: 10px;
    color: var(--login-blue) !important;
    text-decoration: none;
    font-family: "Assistant", sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
}

.register-btn:hover {
    background: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

/* Force login */
.modal-content {
    background: rgba(245, 243, 238, 0.08);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    margin: 20px;
    text-align: center;
    border: 1px solid rgba(245, 243, 238, 0.18);
}

.modal-title {
    font-family: "Assistant", sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--login-cream);
    margin-bottom: 10px;
}

.modal-text {
    font-family: "Assistant", sans-serif;
    color: var(--login-cream);
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.force-login-btn,
.cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: "Assistant", sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.force-login-btn {
    background: var(--login-cream) !important;
    color: var(--login-blue) !important;
}

.force-login-btn:hover {
    background: #ffffff !important;
    transform: translateY(-2px);
}

.cancel-btn {
    background: rgba(245, 243, 238, 0.16) !important;
    color: var(--login-cream) !important;
}

.cancel-btn:hover {
    background: rgba(245, 243, 238, 0.26) !important;
    transform: translateY(-2px);
}

.password-toggle {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: "Assistant", sans-serif;
    font-weight: 600;
    color: var(--login-blue);
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.password-toggle:hover {
    opacity: 1;
}

.login-keyboard-hints {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 0.8rem;
    font-family: "Assistant", sans-serif;
    color: var(--login-cream);
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
        width: 95vw;
        height: auto;
        min-height: auto;
    }

    .login-brand-panel {
        padding: 40px 30px;
        border-left: none;
        border-bottom: 1px solid rgba(245, 243, 238, 0.18);
    }

    .brand-title {
        font-size: 2rem;
    }

    .brand-features {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .login-form-panel {
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .login-container {
        width: 95vw;
        margin: 20px auto;
    }

    .login-brand-panel {
        padding: 30px 20px;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    .brand-subtitle {
        font-size: 1rem;
    }

    .login-form-panel {
        padding: 30px 20px;
    }

    .form-title {
        font-size: 1.8rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .force-login-btn,
    .cancel-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.login-page .login-floating-note,
    .login-container {
        animation: none !important;
    }
}

.submit-btn:focus,
.register-btn:focus,
.force-login-btn:focus,
.cancel-btn:focus {
    outline: 2px solid #2f4550;
    outline-offset: 2px;
}

body.login-page .modern-navbar .menu-trigger span {
    background: var(--login-cream);
}
