/* assets/css/login.css */

/* Farbpalette & Variablen */
:root {
    --primary:       #007bff;
    --primary-dark:  #0056b3;
    --error-bg:      #dc3545;
    --error-text:    #fff;
    --bg-form:       #ffffff;
    --input-bg:      #fff;
    --border:        #ced4da;
    --focus:         #80bdff;
    --transition:    0.3s ease;
}

/* Global Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body & Layout */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;

    /* Space-Background */
    background: #1c1a1a;
    background: url('../pictures/hintergrund_space.png') no-repeat center center fixed;
    background-size: cover;

    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    color: #333;
}

/* Fehlermeldung */
.error {
    width: 100%;
    max-width: 360px;
    background-color: var(--error-bg);
    color: var(--error-text);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: opacity var(--transition);
}

/* Login-Form */
form {
    width: 100%;
    max-width: 360px;
    background-color: var(--bg-form);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition);
}
form:hover {
    transform: translateY(-2px);
}

/* Label & Input */
label {
    display: block;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
}
label input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    margin-top: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--input-bg);
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
label input:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Button */
button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--transition), transform var(--transition);
}
button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

/* Responsive Tweaks */
@media (max-width: 400px) {
    form {
        padding: 1.5rem;
    }
    .error {
        max-width: 280px;
    }
}

/* Loader CSS */
/* Versteckt den Loader initial */
.hidden {
    display: none !important;
}

/* Fullscreen-Overlay */
#loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Klassischer CSS-Kreisel */
#loader::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
