/* =============================================================
 * login.css — Lotly Admin Panel login page (Lotly Simple theme).
 *
 * Self-contained: defines the Lotly Simple --lotly-* tokens it
 * needs inline so the login page doesn't need tokens.css. Brand
 * color (--lotly-orange) is overridden by login/css/palette-*.css
 * loaded after this file.
 * ============================================================= */

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

:root {
    /* Lotly Simple tokens (subset needed by login) */
    --lotly-orange:        #FEA327;
    --lotly-orange-soft:   #FFF7ED;
    --lotly-orange-medium: #FED7AA;
    --lotly-orange-deep:   #B87108;
    --lotly-ink:           #1C1C1C;
    --lotly-ink-soft:      #3C3C3C;
    --lotly-muted:         #6E6E6E;
    --lotly-muted-soft:    #9CA3AF;
    --lotly-line:          #E0E0E0;
    --lotly-line-soft:     #E5E7EB;
    --lotly-surface:       #FFFFFF;
    --lotly-surface-2:     #FAFAFA;
    --lotly-surface-3:     #F7F7F7;
    --lotly-success:       #22C55E;
    --lotly-danger:        #EF4444;

    --radius-md:           8px;
    --radius-lg:           12px;
    --radius-xl:           16px;
    --radius-pill:         999px;

    --font-family:         "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-xs:             11px;
    --font-sm:             12px;
    --font-base:           14px;
    --font-md:             16px;
    --font-lg:             18px;
    --font-xl:             20px;
    --font-2xl:            24px;
    --font-3xl:            28px;

    --shadow-sm:           0 1px 2px rgba(28, 28, 28, 0.06);
    --shadow-md:           0 2px 8px rgba(28, 28, 28, 0.08);
    --shadow-lg:           0 8px 24px rgba(28, 28, 28, 0.12);
}

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

body {
    min-height: 100vh;
    font-family: var(--font-family);
    color: var(--lotly-ink);
    background-color: var(--lotly-surface-3);
    line-height: 1.6;
    font-size: var(--font-base);
}

/* =============================================================
 * Loading spinner
 * ============================================================= */
#loading-container {
    width: 100px;
    height: 100px;
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    margin: auto;
    z-index: 9999;
}

.loading-spinner {
    border: 4px solid var(--lotly-line);
    border-top: 4px solid var(--lotly-orange);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* =============================================================
 * Two-column login shell
 * ============================================================= */
.login-container {
    display: flex;
    min-height: 100vh;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--lotly-orange) 0%, var(--lotly-orange-medium) 100%);
    color: var(--lotly-surface);
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.logo-container {
    margin-bottom: 32px;
    position: relative;
    z-index: 2;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.logo-circle i {
    font-size: 32px;
    color: var(--lotly-surface);
}

.branding-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 8px;
}

.login-brand-logo {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.logo-container h1 {
    font-size: var(--font-3xl);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--lotly-surface);
    margin: 0;
    line-height: 1.2;
}

.logo-container p {
    font-size: var(--font-md);
    opacity: 0.9;
    margin-top: 12px;
    font-weight: 400;
}

/* =============================================================
 * Login card (right column)
 * ============================================================= */
.login-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px;
    background-color: var(--lotly-surface-3);
    position: relative;
}

.loginmodal-container {
    background: var(--lotly-surface);
    padding: 40px;
    border: 1px solid var(--lotly-line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    position: relative;
    top: auto;
    margin: 0;
    opacity: 1;
}

.loginmodal-container h1 {
    color: var(--lotly-ink);
    font-size: var(--font-2xl);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.3px;
    text-align: center;
}

.loginmodal-container p {
    color: var(--lotly-muted);
    font-size: var(--font-base);
    text-align: center;
    margin-bottom: 28px;
}

/* Form inputs — Lotly Simple */
.loginmodal-container input[type=text],
.loginmodal-container input[type=password],
.loginmodal-container input[type=email] {
    width: 100%;
    padding: 12px 14px;
    margin: 10px 0;
    border: 1px solid var(--lotly-line);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-base);
    color: var(--lotly-ink);
    background: var(--lotly-surface);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    min-height: 44px;
}

.loginmodal-container input[type=text]:focus,
.loginmodal-container input[type=password]:focus,
.loginmodal-container input[type=email]:focus {
    border-color: var(--lotly-orange);
    box-shadow: 0 0 0 3px rgba(254, 163, 39, 0.18);
}

.loginmodal-container input::placeholder {
    color: var(--lotly-muted-soft);
}

/* Submit button — Lotly Simple primary */
.loginmodal-container input[type=submit] {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--lotly-orange);
    color: var(--lotly-surface);
    font-family: var(--font-family);
    font-size: var(--font-md);
    font-weight: 600;
    border: 1px solid var(--lotly-orange);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
    min-height: 44px;
}

.loginmodal-container input[type=submit]:hover {
    background-color: var(--lotly-orange-deep);
    border-color: var(--lotly-orange-deep);
    transform: none;
    box-shadow: var(--shadow-sm);
}

.loginmodal-container input[type=submit]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(254, 163, 39, 0.25);
}

/* Error banner */
#error_login {
    color: var(--lotly-danger);
    font-weight: 500;
    text-align: center;
    margin-top: 14px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    display: none;
    font-size: var(--font-sm);
}

#error_login:not(:empty) {
    display: block;
}

.hidden {
    display: none;
}

/* Footer */
.login-footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: var(--lotly-surface);
    background: rgba(28, 28, 28, 0.65);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

/* =============================================================
 * Responsive
 * ============================================================= */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .login-left {
        flex: none;
        min-height: 200px;
        padding: 24px;
    }

    .branding-header {
        flex-direction: column;
        gap: 10px;
    }

    .login-brand-logo {
        height: 32px;
        max-width: 120px;
    }

    .logo-container h1 {
        font-size: var(--font-2xl);
    }

    .logo-circle {
        width: 60px;
        height: 60px;
    }

    .logo-circle i {
        font-size: 24px;
    }

    .login-right {
        padding: 16px;
    }

    .loginmodal-container {
        padding: 24px;
        max-width: none;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .loginmodal-container {
        padding: 20px;
    }

    .loginmodal-container h1 {
        font-size: var(--font-xl);
    }
}
