/* Ausgelagert aus templates/login.html (Frontend-Audit 2026-09-18) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.skip-link{position:absolute;left:-9999px;top:0;z-index:2000;background:#2c5a3d;color:#fff;padding:.75rem 1rem;border-radius:0 0 8px 0;font-weight:600;text-decoration:none}
.skip-link:focus{left:0}

:root {
    --primary-color: #2c5a3d;
    --secondary-color: #4a9362;
    --text-color: #343a40;
    --border-radius: 16px;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Light Gradient Background */
.gradient-bg {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 50%, #d2d2d7 100%);
    z-index: -2;
}

/* Subtle animated overlay via opacity – animiert nur opacity, kein Layout */
.gradient-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #e8e8ed 0%, #d2d2d7 50%, #f5f5f7 100%);
    opacity: 0;
}

@keyframes gradientFade {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Floating Orbs */
.orb {
    display: block;
    position: fixed;
    border-radius: 50%;
    filter: blur(64px);
    opacity: 0.4;
    z-index: -1;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(200, 200, 210, 0.5);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: rgba(220, 220, 230, 0.4);
    bottom: -10%;
    right: -10%;
    animation-delay: 8s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: rgba(210, 210, 220, 0.45);
    top: 50%;
    left: 50%;
    animation-delay: 16s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    z-index: 1;
}

/* Glassmorphism Container */
.login-container {
    width: 100%;
    padding: 2.5rem 2rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow:
        0 8px 40px 0 rgba(0, 0, 0, 0.12),
        0 2px 16px 0 rgba(0, 0, 0, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
    animation: slideUp 0.6s ease-out;
    position: relative;
    transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.login-container.mouse-move-active {
    box-shadow:
        0 12px 48px 0 rgba(0, 0, 0, 0.15),
        0 4px 20px 0 rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
}

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

/* Shake Animation for Errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.login-container.shake {
    animation: shake 0.5s ease-in-out;
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.login-container.success {
    animation: successPulse 0.6s ease-out;
}

/* Confetti Effect */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--secondary-color);
    position: absolute;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.logo-container img {
    width: 100%;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.25));
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.logo-container img.loaded {
    opacity: 1;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Flash Messages */
.flash {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
}

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

.flash.danger {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    background: rgba(44, 90, 61, 0.1);
    padding: 0.4rem;
    border-radius: 12px;
    position: relative;
}

/* Sliding Background Indicator */
.tabs::before {
    content: '';
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    width: calc(50% - 0.4rem);
    height: calc(100% - 0.8rem);
    background: var(--primary-color);
    border-radius: 10px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(44, 90, 61, 0.3);
    z-index: 0;
}

.tabs.voucher-active::before {
    transform: translateX(calc(100% + 0.4rem));
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: white;
}

/* Input Groups with Icons */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.3rem;
    pointer-events: none;
    transition: color 0.3s ease;
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
}

.input-wrapper:focus-within .input-icon {
    color: var(--secondary-color);
}

/* Floating Labels */
label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #666;
    transition: color 0.3s ease;
}

input[type="text"],
input[type="password"],
input[type="checkbox"] {
    font-family: 'DM Sans', sans-serif;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 3rem;
    border: 1px solid #ccc;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    font-weight: 500;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: #999;
}

input[type="text"]:focus-visible,
input[type="password"]:focus-visible {
    outline: 2px solid transparent;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(74, 147, 98, 0.2);
    transform: translateY(-2px);
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 1.3rem;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    font-family: 'Material Symbols Outlined';
}

.password-toggle:hover {
    color: var(--primary-color);
}

/* Remember Me Checkbox */
.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.remember-me input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.6rem;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.remember-me label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #666;
}

/* Submit Button with Loading State */
button[type="submit"] {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease;
}

button[type="submit"]:hover::before {
    opacity: 1;
}

button[type="submit"]:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(44, 90, 61, 0.4);
}

button[type="submit"]:active {
    transform: translateY(-1px);
}

/* Loading Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

button[type="submit"].loading .spinner {
    display: block;
}

button[type="submit"].loading .button-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* QR Scanner Button */
.qr-scan-btn {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.75rem;
    border: 2px dashed var(--secondary-color);
    border-radius: 10px;
    background: rgba(74, 147, 98, 0.1);
    color: var(--secondary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.qr-scan-btn:hover {
    background: rgba(74, 147, 98, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.qr-scan-btn .material-symbols-outlined {
    font-size: 1.5rem;
}

/* QR Scanner Modal */
.qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overscroll-behavior: contain;
}

.qr-modal.active {
    display: flex;
}

.qr-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.qr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.qr-modal-header h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
}

.qr-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 44px;
    height: 44px;
    margin: -0.25rem -0.5rem -0.25rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.qr-close-btn:hover {
    color: var(--primary-color);
}

#qr-reader {
    border-radius: 12px;
    overflow: hidden;
}

/* Tab Content Wrapper for consistent height */
.tab-content-wrapper {
    position: relative;
    overflow: hidden;
}

.tab-content-slider {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tab-content-slider.show-voucher {
    transform: translateX(-100%);
}

/* Tab Content */
.tab-content {
    min-width: 100%;
    flex-shrink: 0;
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   MOBILE ADJUSTMENTS (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    .orb {
        filter: blur(32px);
    }

    .orb-1, .orb-2, .orb-3 {
        width: 250px;
        height: 250px;
    }

    body {
        padding: 3rem 0;
    }

    .login-wrapper {
        padding: 1rem;
    }

    .login-container {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }
}

/* Small Mobile */
@media (max-width: 375px) {
    .login-container {
        padding: 1.5rem 1.25rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .tab-btn {
        font-size: 0.85rem;
        padding: 0.7rem 0.8rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .orb { animation: none !important; }
    .gradient-bg::after { animation: none !important; }
}

/* ── Theme Toggle Button ─────────────────────────────────── */
.theme-toggle-login {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease,
                background 0.3s ease,
                border-color 0.3s ease;
    color: #555;
    padding: 0;
}

.theme-toggle-login:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255,255,255,0.9);
}

.theme-toggle-login:active {
    transform: scale(0.95);
}

.theme-toggle-login svg {
    width: 20px;
    height: 20px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.theme-toggle-login .icon-sun { display: none; }
.theme-toggle-login .icon-moon { display: block; }

/* Dark Mode */
html[data-theme="dark"] .theme-toggle-login {
    background: rgba(15, 25, 18, 0.75);
    border-color: rgba(74, 147, 98, 0.3);
    color: #ffa726;
    box-shadow:
        0 0 14px rgba(233, 162, 41, 0.35),
        0 4px 16px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .theme-toggle-login:hover {
    box-shadow:
        0 0 20px rgba(233, 162, 41, 0.55),
        0 6px 24px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .theme-toggle-login .icon-sun  { display: block; }
html[data-theme="dark"] .theme-toggle-login .icon-moon { display: none; }

/* ── Dark Mode Overrides ────────────────────────────────── */
html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body { color: #f0f0f0; }

html[data-theme="dark"] .gradient-bg {
    background: linear-gradient(135deg, #0a0a0a 0%, #111111 50%, #1a1a1a 100%);
}
html[data-theme="dark"] .gradient-bg::after {
    background: linear-gradient(135deg, #111111 0%, #1a1a1a 50%, #0d0d0d 100%);
}

html[data-theme="dark"] .orb-1 { background: rgba(44, 90, 61, 0.35); }
html[data-theme="dark"] .orb-2 { background: rgba(74, 147, 98, 0.25); }
html[data-theme="dark"] .orb-3 { background: rgba(30, 60, 40, 0.3); }

html[data-theme="dark"] .login-container {
    background: rgba(18, 24, 20, 0.88);
    border-color: rgba(74, 147, 98, 0.2);
    box-shadow:
        0 8px 40px 0 rgba(0, 0, 0, 0.5),
        0 2px 16px 0 rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(74, 147, 98, 0.15);
}

html[data-theme="dark"] h1 { color: #66bb6a; }
html[data-theme="dark"] .subtitle { color: #9aa89e; }
html[data-theme="dark"] label { color: #8a9e92; }

html[data-theme="dark"] .tabs { background: rgba(74, 147, 98, 0.15); }
html[data-theme="dark"] .tab-btn { color: #7a8f82; }
html[data-theme="dark"] .tab-btn:hover { color: #66bb6a; }
html[data-theme="dark"] .tab-btn.active { color: #fff; }

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"] {
    background-color: rgba(30, 42, 35, 0.9);
    border-color: rgba(74, 147, 98, 0.3);
    color: #f0f0f0;
}
html[data-theme="dark"] input[type="text"]::placeholder,
html[data-theme="dark"] input[type="password"]::placeholder { color: #5a6b5f; }
html[data-theme="dark"] input[type="text"]:focus-visible,
html[data-theme="dark"] input[type="password"]:focus-visible {
    border-color: #66bb6a;
    background-color: rgba(40, 58, 46, 0.95);
    box-shadow: 0 0 0 4px rgba(74, 147, 98, 0.2);
}

html[data-theme="dark"] .input-icon { color: #5a6b5f; }
html[data-theme="dark"] .password-toggle { color: #5a6b5f; }
html[data-theme="dark"] .password-toggle:hover { color: #66bb6a; }

html[data-theme="dark"] .remember-me label { color: #7a8f82; }

html[data-theme="dark"] .flash.danger {
    background-color: rgba(160, 30, 40, 0.3);
    color: #f8b4b8;
    border-color: rgba(200, 70, 80, 0.35);
}

html[data-theme="dark"] .qr-modal-content {
    background: #1a2420;
    color: #f0f0f0;
}
html[data-theme="dark"] .qr-modal-header h2 { color: #66bb6a; }
html[data-theme="dark"] .qr-close-btn { color: #5a6b5f; }

/* Bewegte Orbs und der Verlaufs-Fade nur auf Desktop ohne reduced-motion.
   Auf dem Handy standen drei 300-400px-Orbs mit blur(100px) in Dauerbewegung
   hinter einer Karte mit backdrop-filter: blur(60px): jeder Frame musste den
   Hintergrund neu blurren. Statisch kostet der Blur nur einmal. */
@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
    .orb { animation: float 25s infinite ease-in-out; }
    .gradient-bg::after { animation: gradientFade 20s ease infinite; }
}
