/* ============================================================
   css/login.css – Styles für die Login-Seite
   Einbinden in login.php:
   <link rel="stylesheet" href="css/login.css">
   ============================================================ */

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

/* ── Reset & Basis ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green:        #04AA6D;
    --green-dark:   #038a58;
    --green-light:  #05c97e;
    --bg-panel:     #0f1117;
    --bg-form:      #161b27;
    --border:       rgba(255,255,255,0.08);
    --text:         #e8eaf0;
    --text-muted:   #7a8299;
    --error-bg:     rgba(239, 68, 68, 0.12);
    --error-border: rgba(239, 68, 68, 0.4);
    --error-text:   #fca5a5;
    --warn-bg:      rgba(234, 179, 8, 0.12);
    --warn-border:  rgba(234, 179, 8, 0.4);
    --warn-text:    #fde047;
    --radius:       10px;
}

html, body {
    height: 100%;
    font-family: 'Outfit', sans-serif;
    background: var(--bg-panel);
    color: var(--text);
}

/* ── Layout: 2/3 Bild | 1/3 Formular ── */
.login-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Linke Seite: Hintergrundbild (2/3) ── */
.login-hero {
    flex: 2;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(4,170,109,0.35) 0%, rgba(0,0,0,0.7) 100%),
        url('../assets/bg.jpg') center/cover no-repeat;
    background-color: #0a1628; /* Fallback wenn kein Bild vorhanden */
}

.login-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 60%, rgba(4,170,109,0.2) 0%, transparent 65%);
}

/* ── Geometrische Deko-Elemente ── */
.hero-deco {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-deco span {
    position: absolute;
    border: 1px solid rgba(4,170,109,0.2);
    border-radius: 50%;
}

.hero-deco span:nth-child(1) {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    animation: pulse-ring 6s ease-in-out infinite;
}

.hero-deco span:nth-child(2) {
    width: 600px;
    height: 600px;
    top: -200px;
    left: -200px;
    animation: pulse-ring 6s ease-in-out infinite 1.5s;
}

.hero-deco span:nth-child(3) {
    width: 250px;
    height: 250px;
    bottom: 80px;
    right: 40px;
    animation: pulse-ring 8s ease-in-out infinite 3s;
}

@keyframes pulse-ring {
    0%, 100% { opacity: 0.3; transform: scale(1);    }
    50%       { opacity: 0.7; transform: scale(1.05); }
}

/* ── Claim-Text auf dem Bild ── */
.hero-content {
    position: absolute;
    bottom: 60px;
    left: 50px;
    right: 50px;
    z-index: 2;
}

.hero-content h2 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-content h2 span {
    color: var(--green-light);
}

.hero-content p {
    margin-top: 12px;
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    font-weight: 300;
}

/* ── Rechte Seite: Formular (1/3) ── */
.login-panel {
    flex: 1;
    min-width: 380px;
    max-width: 480px;
    background: var(--bg-form);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    position: relative;
    border-left: 1px solid var(--border);
}

/* Grüner Akzentstreifen oben */
.login-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
}

/* ── Logo ── */
.login-logo {
    margin-bottom: 36px;
    text-align: center;
}

.login-logo img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.login-logo .logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -1px;
    box-shadow: 0 8px 32px rgba(4,170,109,0.35);
}

.login-logo p {
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Formular-Kopf ── */
.login-heading {
    width: 100%;
    margin-bottom: 32px;
}

.login-heading h1 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text);
}

.login-heading p {
    margin-top: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* ── Meldungen ── */
.msg {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
    animation: slide-in 0.3s ease;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.msg::before {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.msg--error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.msg--error::before  { content: '⚠'; }

.msg--warning {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    color: var(--warn-text);
}

.msg--warning::before { content: '⏱'; }

.msg--locked {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.msg--locked::before  { content: '🔒'; }

/* ── Formular ── */
form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
}

.input-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 13px 16px 13px 44px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--green);
    background: rgba(4,170,109,0.05);
    box-shadow: 0 0 0 3px rgba(4,170,109,0.12);
}

/* ── Passwort-Toggle ── */
.toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    transition: color 0.2s;
}

.toggle-pw:hover { color: var(--text); }

.toggle-pw svg {
    width: 17px;
    height: 17px;
}

/* ── Login-Button ── */
.btn-login {
    width: 100%;
    padding: 14px;
    margin-top: 4px;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    box-shadow: 0 4px 20px rgba(4,170,109,0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(4,170,109,0.4);
    filter: brightness(1.05);
}

.btn-login:hover::after { opacity: 1; }

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(4,170,109,0.3);
}

/* ── Footer ── */
.login-footer {
    margin-top: 32px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .login-hero {
        display: none;
    }

    .login-panel {
        max-width: 100%;
        min-width: 100%;
    }
}

/* ── SSO Login ────────────────────────────────────────────── */
.sso-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
}
.sso-divider::before,
.sso-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, rgba(255,255,255,.08));
}

.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 10px;
    color: #93c5fd;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-sso:hover {
    background: rgba(96, 165, 250, 0.16);
    border-color: rgba(96, 165, 250, 0.4);
}
.btn-sso svg { width: 18px; height: 18px; }

.msg--info {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 8px;
    padding: 10px 14px;
    color: #93c5fd;
    font-size: 0.85rem;
    margin-bottom: 14px;
}
