/* ═══════════════════════════════════════════════════════════
   Stiefeld Mail – Design System & Login
   ═══════════════════════════════════════════════════════════ */

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

/* ─── Custom Scrollbars ─── */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--clr-scrollbar) transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--clr-scrollbar);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--clr-scrollbar-hover);
    background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }

:root {
    /* Brand – abgeleitet vom Stiefeld-Logo (Lila/Purple) */
    --clr-primary:       #9333ea;
    --clr-primary-h:     #7c3aed;
    --clr-accent:        #10b981;
    --clr-danger:        #ef4444;
    --clr-warning:       #f59e0b;

    /* Dark Theme (default) */
    --clr-bg:            #0c0e14;
    --clr-surface:       #151823;
    --clr-card:          rgba(21, 24, 35, .82);
    --clr-border:        rgba(255, 255, 255, .07);
    --clr-text:          #7a8299;
    --clr-text-light:    #e2e5ed;
    --clr-heading:       #ffffff;
    --clr-overlay:       rgba(255, 255, 255, .04);
    --clr-overlay-hover: rgba(255, 255, 255, .07);
    --clr-shadow:        rgba(0, 0, 0, .5);
    --clr-scrollbar:       rgba(255, 255, 255, .12);
    --clr-scrollbar-hover: rgba(255, 255, 255, .22);

    /* Typography */
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --radius: 12px;
    --shadow: 0 8px 32px var(--clr-shadow);
}

/* ─── Light Theme ─── */
[data-theme="light"] {
    --clr-bg:            #f0f2f5;
    --clr-surface:       #ffffff;
    --clr-card:          rgba(255, 255, 255, .9);
    --clr-border:        rgba(0, 0, 0, .08);
    --clr-text:          #6b7280;
    --clr-text-light:    #1a1d2e;
    --clr-heading:       #111827;
    --clr-overlay:       rgba(0, 0, 0, .03);
    --clr-overlay-hover: rgba(0, 0, 0, .06);
    --clr-shadow:        rgba(0, 0, 0, .08);
    --clr-scrollbar:       rgba(0, 0, 0, .18);
    --clr-scrollbar-hover: rgba(0, 0, 0, .3);
}

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

html { font-size: 16px; }

body {
    font-family: var(--font);
    font-weight: 400;
    background: var(--clr-bg);
    color: var(--clr-text-light);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ─── Animated Background ─── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 100% 70% at 50% 110%, rgba(147, 51, 234, .15), transparent 60%),
        radial-gradient(ellipse 60% 50% at 20% 100%, rgba(16, 185, 129, .08), transparent 50%),
        radial-gradient(ellipse 50% 40% at 80% 105%, rgba(124, 58, 237, .1), transparent 50%);
    animation: bgPulse 5s ease-in-out infinite alternate;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 100% 70% at 50% 110%, rgba(147, 51, 234, .06), transparent 60%),
        radial-gradient(ellipse 60% 50% at 20% 100%, rgba(16, 185, 129, .04), transparent 50%);
}

@keyframes bgPulse {
    0%   { opacity: .6; transform: scaleY(1); }
    50%  { opacity: 1;  transform: scaleY(1.03) translateY(-6px); }
    100% { opacity: .7; transform: scaleY(.98); }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ─── Card ─── */
.card {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 1rem;
    max-width: 420px;
    padding: 2.5rem 2rem 2rem;
    background: var(--clr-card);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: cardIn .5s cubic-bezier(.22, 1, .36, 1) both;
}

/* ─── Brand ─── */
.brand { text-align: center; margin-bottom: 2rem; }

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin-bottom: 1rem;
}

.brand-icon svg { width: 32px; height: 32px; fill: #fff; }
.brand-icon img { width: 100%; height: 100%; object-fit: contain; }

.brand h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--clr-heading);
    letter-spacing: -.02em;
    margin-bottom: .3rem;
}

.brand p {
    font-size: .82rem;
    color: var(--clr-text);
}

/* ─── Alert ─── */
.alert {
    display: none;
    align-items: center;
    gap: .4rem;
    padding: .6rem .8rem;
    margin-bottom: 1rem;
    font-size: .82rem;
    border-radius: 10px;
}

.alert.visible { display: flex; }

.alert svg { flex-shrink: 0; width: 16px; height: 16px; }

.alert-error {
    color: var(--clr-danger);
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .18);
}

.alert-error svg { fill: var(--clr-danger); }

/* ─── Button ─── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    width: 100%;
    padding: .85rem;
    font-size: .95rem;
    font-weight: 600;
    font-family: var(--font);
    color: #fff;
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-h));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .15s, box-shadow .25s;
    box-shadow: 0 4px 16px rgba(147, 51, 234, .25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(147, 51, 234, .35);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary .spinner {
    display: none;
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .spinner  { display: block; }

.btn-primary svg { width: 20px; height: 20px; fill: #fff; }

/* ─── Footer ─── */
footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1;
    text-align: center;
    padding: .8rem 1rem;
    font-size: .68rem;
    color: var(--clr-text);
    letter-spacing: .03em;
    opacity: .4;
    background: linear-gradient(to top, var(--clr-bg), transparent);
}

footer span { margin: 0 .3rem; }

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .card { padding: 2rem 1.4rem 1.6rem; border-radius: 10px; }
    .brand h1 { font-size: 1.15rem; }
}
