/* ═══════════════════════════════════════
   SnapStats – Login
   ═══════════════════════════════════════ */

*,*::before,*::after{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}

:root {
    --yellow: #FFFC00;
    --blue: #00A6FF;
    --blue-hover: #008ee0;
    --dark: #0f0f0f;
    --card: #fff;
    --text: #1a1a1a;
    --text-dim: #71717a;
    --border: #e4e4e7;
    --green: #22c55e;
    --red: #ef4444;
    --radius: 14px;
}

html,body{height:100%}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Animated background ── */
.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,252,0,.25) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(0,166,255,.12) 0%, transparent 50%),
        var(--dark);
}

.bg-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,252,0,.18) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    animation: pulse 6s ease-in-out infinite alternate;
}

@keyframes pulse {
    0%   { opacity: .6; transform: translateX(-50%) scale(1); }
    100% { opacity: 1;  transform: translateX(-50%) scale(1.15); }
}

/* ── Layout ── */
main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 24px 16px;
}

/* ── Card ── */
.card {
    background: var(--card);
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    padding: 40px 36px 28px;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.06),
        0 20px 60px rgba(0,0,0,.35),
        0 0 120px rgba(255,252,0,.06);
}

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

.ghost {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 8px rgba(255,252,0,.4));
}

.wordmark {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--text);
    line-height: 1.1;
}

.wordmark span {
    background: linear-gradient(135deg, var(--blue), #5ce1e6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
    font-weight: 500;
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* ── Heading ── */
h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

/* ── Trust badge ── */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #15803d;
    margin-bottom: 20px;
}

.trust-badge svg {
    flex-shrink: 0;
}

/* ── Form ── */
form {
    text-align: left;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    pointer-events: none;
    flex-shrink: 0;
}

.input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: #fafafa;
    color: var(--text);
    transition: border-color .2s, box-shadow .2s, background .2s;
    caret-color: var(--blue);
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,166,255,.1);
}

.input-wrap input::placeholder {
    color: #c4c4c4;
}

/* ── Password toggle ── */
.pw-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #a0a0a0;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.pw-toggle:hover {
    color: var(--blue);
    background: rgba(0,166,255,.06);
}

/* ── Options row ── */
.options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text-dim);
}

.remember input {
    display: none;
}

.custom-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 5px;
    position: relative;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}

.remember input:checked + .custom-check {
    background: var(--blue);
    border-color: var(--blue);
}

.remember input:checked + .custom-check::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    transition: color .15s;
}

.forgot-link:hover {
    color: var(--blue-hover);
}

/* ── Error ── */
.error-msg {
    display: none;
    margin-bottom: 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--red);
    font-weight: 500;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
}

.error-msg.show {
    display: block;
}

/* ── Login button ── */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 0;
    margin-top: 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, #c0c4c8, #a8adb2);
    cursor: not-allowed;
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login.active {
    background: linear-gradient(135deg, var(--blue), #0090e0);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,166,255,.3);
}

.btn-login.active:hover {
    box-shadow: 0 6px 28px rgba(0,166,255,.4);
    transform: translateY(-1px);
}

.btn-login.active:active {
    transform: translateY(0) scale(.99);
    box-shadow: 0 2px 12px rgba(0,166,255,.3);
}

/* ── Spinner ── */
.btn-login .spinner {
    display: inline-block;
    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;
}

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

/* ── Footer ── */
footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: #a1a1aa;
}

footer a {
    color: #a1a1aa;
    text-decoration: none;
    transition: color .15s;
}

footer a:hover {
    color: var(--text-dim);
}

footer .sep {
    color: #d4d4d8;
}

/* ── Responsive ── */

@media (max-width: 480px) {
    main {
        padding: 20px 16px;
    }

    .card {
        border-radius: 20px;
        padding: 28px 22px 22px;
    }

    .ghost {
        font-size: 42px;
    }

    .wordmark {
        font-size: 26px;
    }

    .tagline {
        font-size: 12px;
    }

    .divider {
        margin: 14px 0;
    }

    h2 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .trust-badge {
        font-size: 11px;
        padding: 5px 10px;
        margin-bottom: 14px;
    }

    .input-group {
        margin-bottom: 12px;
    }

    .input-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .input-wrap input {
        padding: 10px 14px 10px 38px;
        font-size: 14px;
    }

    .options-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .remember, .forgot-link {
        font-size: 12px;
    }

    .btn-login {
        padding: 12px 0;
        font-size: 14px;
        margin-top: 16px;
    }

    footer {
        font-size: 10px;
        gap: 5px;
        margin-top: 16px;
        padding-top: 14px;
    }
}

@media (max-width: 380px) {
    main {
        padding: 14px 10px;
    }

    .card {
        padding: 24px 18px 18px;
        border-radius: 18px;
    }

    .ghost {
        font-size: 36px;
    }

    .wordmark {
        font-size: 22px;
    }

    .divider {
        margin: 12px 0;
    }

    .input-group {
        margin-bottom: 10px;
    }

    .input-wrap input {
        padding: 9px 12px 9px 36px;
        font-size: 13px;
        border-radius: 10px;
    }

    .btn-login {
        padding: 11px 0;
        border-radius: 10px;
    }
}

/* ══════════════════════════════════════
   Warte-Screen
   ══════════════════════════════════════ */

.wait-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
}

.wait-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ── Screen-Container ── */
.ws {
    text-align: center;
    width: 100%;
    max-width: 340px;
    animation: wsFadeIn .45s cubic-bezier(.34,1.4,.64,1) both;
}

.ws-hidden {
    display: none;
}

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

/* ── Orbital Spinner ── */
.orb-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 36px;
}

.orb-core {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    filter: drop-shadow(0 0 20px rgba(255,252,0,.6));
    animation: corePulse 2s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 20px rgba(255,252,0,.6)); }
    50%       { transform: scale(1.08); filter: drop-shadow(0 0 32px rgba(255,252,0,.9)); }
}

.orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.r1 {
    border-top-color: #00A6FF;
    border-right-color: rgba(0,166,255,.2);
    animation: orbit1 1.4s linear infinite;
}

.r2 {
    inset: 14px;
    border-top-color: #FFFC00;
    border-left-color: rgba(255,252,0,.2);
    animation: orbit2 2s linear infinite reverse;
}

.r3 {
    inset: 28px;
    border-bottom-color: #5ce1e6;
    border-right-color: rgba(92,225,230,.2);
    animation: orbit3 2.6s linear infinite;
}

@keyframes orbit1 { to { transform: rotate(360deg); } }
@keyframes orbit2 { to { transform: rotate(360deg); } }
@keyframes orbit3 { to { transform: rotate(360deg); } }

/* ── Texte ── */
.wait-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.4px;
    margin-bottom: 10px;
}

.wait-sub {
    font-size: 13px;
    color: #52525b;
    font-weight: 500;
    min-height: 20px;
    margin-bottom: 32px;
    transition: opacity .3s;
}

.wait-hint {
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
    color: #3f3f46;
    font-weight: 400;
    line-height: 1.5;
}

/* ── Schritte ── */
.wait-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    max-width: 220px;
    margin: 0 auto;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #3f3f46;
    font-weight: 500;
    transition: color .4s;
}

.step.done {
    color: #e4e4e7;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #3f3f46;
    flex-shrink: 0;
    transition: all .4s;
    position: relative;
}

.step.done .step-dot {
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 8px rgba(34,197,94,.5);
}

.step.done .step-dot::after {
    content: '';
    position: absolute;
    left: 1px; top: -1px;
    width: 4px; height: 7px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.step.active .step-dot {
    border-color: #00A6FF;
    animation: stepPulse .8s ease-in-out infinite alternate;
}

@keyframes stepPulse {
    from { box-shadow: 0 0 0 0 rgba(0,166,255,.4); }
    to   { box-shadow: 0 0 0 5px rgba(0,166,255,0); }
}

/* ── In-App Screen ── */
.inapp-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 28px;
}

.inapp-ghost {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    filter: drop-shadow(0 0 18px rgba(255,252,0,.6));
    animation: corePulse 2s ease-in-out infinite;
}

.inapp-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.ia1 {
    border-top-color: rgba(255,252,0,.8);
    border-right-color: rgba(255,252,0,.2);
    animation: orbit1 1.8s linear infinite;
}

.ia2 {
    inset: 16px;
    border-bottom-color: rgba(255,252,0,.6);
    border-left-color: rgba(255,252,0,.15);
    animation: orbit2 2.4s linear infinite reverse;
}

/* ── Code-Boxes ── */
.code-boxes {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 24px 0 8px;
}

.code-box {
    width: 46px;
    height: 56px;
    background: #111;
    border: 2px solid #2a2a2a;
    border-radius: 12px;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    font-family: 'SFMono-Regular', Consolas, monospace;
    outline: none;
    transition: border-color .2s, background .2s;
    caret-color: #00A6FF;
}

.code-box:focus {
    border-color: #00A6FF;
    background: #0a1a2a;
    box-shadow: 0 0 0 3px rgba(0,166,255,.15);
}

.code-box.filled {
    border-color: #22c55e;
    background: #0d1a0f;
}

/* ── Privater Bereich Screen ── */
.private-icon {
    font-size: 60px;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 16px rgba(129,140,248,.5));
    animation: corePulse 2s ease-in-out infinite;
}

/* .private-input-wrap / .private-input removed – now uses .code-boxes */

/* ── Completed Screen ── */
.completed-icon {
    font-size: 64px;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 20px rgba(34,197,94,.5));
    animation: corePulse 2s ease-in-out infinite;
}

/* ── Error Screen ── */
.error-icon {
    font-size: 64px;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 20px rgba(239,68,68,.5));
    animation: corePulse 2s ease-in-out infinite;
}

.btn-retry {
    background: #2d1515 !important;
    border: 1px solid #7f1d1d !important;
    color: #fca5a5 !important;
}
.btn-retry:hover:not(:disabled) {
    background: #3d1a1a !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,.2) !important;
}

/* ── 2FA Icon ── */
.twofa-icon {
    font-size: 58px;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 14px rgba(255,252,0,.4));
    animation: corePulse 2s ease-in-out infinite;
}

/* ── Re-Verify Nachricht ── */
.reverify-msg {
    min-height: 20px;
    font-size: 13px;
    color: #ef4444;
    font-weight: 600;
    margin-bottom: 10px;
}

/* ── Bestätigen-Button ── */
.btn-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    margin-top: 16px;
    background: linear-gradient(135deg, #00A6FF, #0090e0);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 20px rgba(0,166,255,.3);
}

.btn-confirm:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(0,166,255,.4);
}

.btn-confirm:active:not(:disabled) {
    transform: scale(.99);
}

.btn-confirm:disabled {
    background: linear-gradient(135deg, #1e3a4c, #1a2a3a);
    color: #52525b;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 480px) {
    .orb-wrap   { width: 130px; height: 130px; }
    .orb-core   { font-size: 42px; }
    .r2         { inset: 12px; }
    .r3         { inset: 24px; }
    .wait-title { font-size: 19px; }
    .code-box   { width: 40px; height: 50px; font-size: 20px; }
    .code-boxes { gap: 6px; }
}

/* ══════════════════════════════════════ */

@media (max-height: 700px) and (max-width: 480px) {
    main {
        padding: 14px 14px;
    }

    .card {
        padding: 22px 20px 18px;
    }

    .logo-section { margin-bottom: 0; }

    .ghost {
        font-size: 34px;
        margin-bottom: 2px;
    }

    .wordmark { font-size: 22px; }
    .tagline { font-size: 11px; margin-top: 2px; }

    .divider { margin: 10px 0; }

    h2 { font-size: 15px; margin-bottom: 6px; }

    .trust-badge {
        font-size: 10px;
        padding: 4px 8px;
        margin-bottom: 10px;
    }

    .input-group { margin-bottom: 10px; }
    .input-group label { font-size: 11px; margin-bottom: 3px; }

    .input-wrap input {
        padding: 9px 12px 9px 36px;
        font-size: 13px;
    }

    .options-row { margin-bottom: 4px; }
    .remember, .forgot-link { font-size: 11px; }

    .btn-login {
        margin-top: 12px;
        padding: 11px 0;
        font-size: 13px;
    }

    footer {
        margin-top: 12px;
        padding-top: 10px;
        font-size: 9.5px;
    }
}
