/* === LOGIN FORM STYLING (Hoyer Corporate Edition) === */

*, *::before, *::after {
    box-sizing: border-box;
}

/* --- GLOBALE VARIABLEN (Markenfarben & Themes) --- */
:root {
    /* Hoyer CI Farben */
    --brand-red: #e60028; /* RGB: 230, 0, 40 */
    --brand-blue: #05235F; /* RGB: 5, 35, 95 */

    /* Light Theme */
    --page-bg: #f4f6f9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --login-input-bg: #f8fafc;
    --login-icon-color: #64748b;
    --heading-color: #0f172a;
    --text-main: #334155;
    --text-muted: #64748b;
    --blob-opacity: 0.12;
}

[data-theme="dark"] {
    /* Dark Theme */
    --page-bg: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --login-input-bg: #0f172a;
    --login-icon-color: #94a3b8;
    --heading-color: #f8fafc;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --blob-opacity: 0.08;
}

body {
    background-color: var(--page-bg);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* --- BACKGROUND BLOBS (Rot & Blau) --- */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    filter: blur(150px);
    opacity: var(--blob-opacity);
    transition: opacity 0.4s ease;
    animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 700px;
    height: 700px;
    background: var(--brand-red);
    top: -200px;
    left: -200px;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: var(--brand-blue);
    bottom: -100px;
    right: -100px;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

/* --- LAYOUT --- */
.login-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 460px;
    padding: 50px 40px 40px;
    margin: auto; /* Zentriert die Box im Body */
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

[data-theme="dark"] .login-box {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

/* --- HEADER & LOGO --- */
.login-header {
    text-align: center;
    margin-bottom: 45px;
    position: relative;
}

.loginlogo {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--brand-red) 0%, #bd0021 100%);
    padding: 20px 45px;
    border-radius: 20px;
    margin: 0 auto 30px;
    position: relative;
    z-index: 1;

    box-shadow: 0 10px 25px rgba(230, 0, 40, 0.25),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);

    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.loginlogo img {
    width: 250px;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.4s ease;
}

.login-box:hover .loginlogo {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px rgba(230, 0, 40, 0.35),
    inset 0 3px 6px rgba(255, 255, 255, 0.3);
}

.login-box:hover .loginlogo img {
    transform: scale(1.03);
}

.login-header h1 {
    font-size: 1.7rem;
    color: var(--heading-color);
    margin: 0 0 8px 0;
    transition: color 0.4s ease;
    font-weight: 800;
}

.login-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
    transition: color 0.4s ease;
}

/* --- ALERTS --- */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(230, 0, 40, 0.1);
    color: var(--brand-red);
    border: 1px solid rgba(230, 0, 40, 0.2);
}

/* --- FORM & INPUTS --- */
.input-group {
    position: relative;
    margin-bottom: 22px;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--login-icon-color);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.input-group input {
    width: 100%;
    background: var(--login-input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 16px 16px 16px 52px;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: background-color 0.4s ease, border-color 0.2s ease, color 0.4s ease, box-shadow 0.2s ease;
}

.input-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.input-group input:focus {
    border-color: var(--brand-blue);
    background: var(--card-bg);
    /* Edler Fokus-Ring im Hoyer-Blau */
    box-shadow: 0 0 0 4px rgba(5, 35, 95, 0.15);
}

.input-group input:focus + .input-icon,
.input-group input:not(:placeholder-shown) + .input-icon {
    color: var(--brand-blue);
}

[data-theme="dark"] .input-group input:focus {
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.15);
}

[data-theme="dark"] .input-group input:focus + .input-icon,
[data-theme="dark"] .input-group input:not(:placeholder-shown) + .input-icon {
    color: #e2e8f0;
}

/* --- BUTTON --- */
.btnlogin {
    width: 100%;
    background: linear-gradient(135deg, var(--brand-red) 0%, #c70024 100%);
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    box-shadow: 0 6px 20px rgba(230, 0, 40, 0.3);
    transition: all 0.3s ease;
}

.btnlogin:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(230, 0, 40, 0.45);
    filter: brightness(1.1);
}

/* --- FOOTER LINKS --- */
.login-footer {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
}

.login-footer a {
    color: var(--text-muted);
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
}

.login-footer a:first-child { text-align: right; }
.login-footer a:last-child { text-align: left; }

.login-footer a:hover {
    color: var(--brand-blue);
    transform: translateY(-1px);
}

[data-theme="dark"] .login-footer a:hover {
    color: #ffffff;
}

.login-footer .divider {
    color: var(--border-color);
    font-size: 1.3rem;
    line-height: 1;
    user-select: none;
}

/* --- ANIMATIONS --- */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

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

/* --- RESPONSIVE --- */
@media (max-width: 500px) {
    .login-box { padding: 40px 25px 30px; }
    .loginlogo { padding: 15px 30px; margin-bottom: 20px; }
    .loginlogo img { width: 180px; }
    .login-header h1 { font-size: 1.4rem; }
}

@media (max-width: 400px) {
    .login-footer {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .login-footer a:first-child, .login-footer a:last-child {
        text-align: center;
    }
    .login-footer .divider {
        display: none;
    }
}