/* ════════════════════════════════════════════════════════════════
   Ragnarök File Transfer — Aurora / Norse Dark Theme
   Vollständiger optischer Redesign. Funktionalität & IDs unverändert.
   ════════════════════════════════════════════════════════════════ */

:root {
    /* Flächen */
    --bg:            #06060a;
    --bg-2:          #0a0a12;
    --surface:       rgba(22, 22, 34, 0.55);
    --surface-2:     rgba(30, 30, 46, 0.55);
    --surface-solid: #101019;
    --inset:         rgba(8, 8, 14, 0.6);

    /* Linien */
    --border:        rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --hairline:      rgba(255, 255, 255, 0.05);

    /* Text */
    --text:          #ececf2;
    --text-muted:    #9090a6;
    --text-dim:      #5a5a70;

    /* Akzent (Aurora violett → cyan) */
    --accent:        #8b7cff;
    --accent-2:      #59c9ff;
    --accent-3:      #c084fc;
    --accent-soft:   rgba(139, 124, 255, 0.14);
    --accent-line:   rgba(139, 124, 255, 0.45);
    --grad-accent:   linear-gradient(135deg, #8b7cff 0%, #6f74ff 45%, #59c9ff 100%);
    --grad-accent-h: linear-gradient(135deg, #9c8eff 0%, #8085ff 45%, #74d4ff 100%);

    /* Status */
    --success:       #44e0a0;
    --success-soft:  rgba(68, 224, 160, 0.12);
    --error:         #ff6b81;
    --error-soft:    rgba(255, 107, 129, 0.12);

    /* Schatten / Radien / Timing */
    --shadow:        0 24px 60px -20px rgba(0, 0, 0, 0.75);
    --shadow-sm:     0 8px 24px -10px rgba(0, 0, 0, 0.6);
    --glow:          0 0 40px -6px rgba(139, 124, 255, 0.45);
    --radius-xl:     22px;
    --radius:        16px;
    --radius-sm:     11px;
    --ease:          0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* ─── Aurora-Hintergrund ─── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60rem 40rem at 15% -10%, rgba(139, 124, 255, 0.16), transparent 60%),
        radial-gradient(50rem 38rem at 90% 0%, rgba(89, 201, 255, 0.12), transparent 55%),
        radial-gradient(45rem 35rem at 50% 115%, rgba(192, 132, 252, 0.10), transparent 60%),
        var(--bg);
}

/* feines Rauschen / Vignette für Tiefe */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(120% 120% at 50% 30%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ════════════════════════════ Layout ════════════════════════════ */

.container {
    width: 100%;
    max-width: 560px;
    padding: 2.5rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100vh;
}

/* ─── Top-Leiste (Logo + Account) ─── */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

/* Download-/Unterseiten ohne Account-Widget: Logo zentriert */
header:not(.topbar) {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0 0.25rem;
}

.logo {
    text-decoration: none;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-badge {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--grad-accent);
    box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
}

.logo-icon {
    font-size: 1.6rem;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.logo-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(90deg, #fff, #c9c4ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub,
.logo .subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ════════════════════════════ Karten ════════════════════════════ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

/* oberer Lichtsaum auf jeder Karte */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.card-head {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.card-desc {
    font-size: 0.83rem;
    color: var(--text-muted);
}

/* ════════════════════════════ Account-Widget ════════════════════════════ */

.auth-box {
    width: 100%;
    max-width: 250px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    box-shadow: var(--shadow-sm);
}

.auth-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.auth-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
}

.auth-avatar.is-user {
    background: var(--grad-accent);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--glow);
}

.auth-identity {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.auth-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-state {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.auth-state::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-dim);
}

.auth-box:has(.is-user) .auth-state::before {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.auth-note {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.45;
    margin: 0;
}

/* ════════════════════════════ Buttons ════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ease);
    text-decoration: none;
    font-family: inherit;
    background: var(--grad-accent);
    color: #fff;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 18px -8px rgba(111, 116, 255, 0.7);
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 45%);
    opacity: 0.6;
    pointer-events: none;
}

.btn:hover {
    background: var(--grad-accent-h);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -8px rgba(111, 116, 255, 0.6);
}

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

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: grayscale(0.3);
}

.btn-auth {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
}

.btn-secondary,
.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    box-shadow: none;
}

.btn-secondary::after,
.btn-ghost::after {
    display: none;
}

.btn-ghost {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
}

.btn-secondary:hover,
.btn-ghost:hover {
    border-color: var(--accent-line);
    color: var(--text);
    background: var(--accent-soft);
    transform: translateY(-1px);
    box-shadow: none;
}

.btn-download {
    background: linear-gradient(135deg, #44e0a0, #2bd0bd);
    color: #04140e;
    box-shadow: 0 8px 22px -8px rgba(68, 224, 160, 0.6);
}

.btn-download:hover {
    background: linear-gradient(135deg, #5cf0b2, #45e0cc);
    box-shadow: 0 12px 30px -8px rgba(68, 224, 160, 0.55);
}

.dl-arrow {
    font-size: 1.15rem;
    font-weight: bold;
}

/* ════════════════════════════ Upload-Form ════════════════════════════ */

.upload-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

/* ─── Dropzone ─── */

.dropzone {
    width: 100%;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 2.75rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--ease);
    position: relative;
    background:
        radial-gradient(80% 100% at 50% 0%, rgba(139, 124, 255, 0.05), transparent 70%),
        var(--inset);
}

.dropzone:hover,
.dropzone.drag-over {
    border-color: var(--accent-line);
    background:
        radial-gradient(80% 120% at 50% 0%, rgba(139, 124, 255, 0.16), transparent 70%),
        var(--inset);
    transform: translateY(-1px);
}

.dropzone-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--border);
    transition: var(--ease);
}

.dropzone:hover .dropzone-icon,
.dropzone.drag-over .dropzone-icon {
    color: #fff;
    background: var(--grad-accent);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: var(--glow);
}

.dropzone p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dropzone p strong {
    color: var(--text);
    font-weight: 600;
}

.dropzone .hint {
    font-size: 0.74rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ─── Datei-Vorschau ─── */

.file-preview {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    background: var(--inset);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.file-preview .file-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    background: var(--accent-soft);
    border: 1px solid var(--border);
}

.file-preview .file-details {
    flex: 1;
    min-width: 0;
}

.file-preview .file-name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview .file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

.file-preview .file-remove {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    display: grid;
    place-items: center;
    transition: var(--ease);
    flex-shrink: 0;
}

.file-preview .file-remove:hover {
    color: var(--error);
    border-color: var(--error);
    background: var(--error-soft);
}

/* ─── Passwort ─── */

.password-section {
    width: 100%;
}

.password-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.7rem;
}

.password-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--border-strong);
    border-radius: 6px;
    background: var(--inset);
    cursor: pointer;
    transition: var(--ease);
    position: relative;
    flex-shrink: 0;
}

.password-toggle input[type="checkbox"]:checked {
    background: var(--grad-accent);
    border-color: transparent;
}

.password-toggle input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
}

.password-input-wrap {
    display: none;
}

.password-input-wrap.visible {
    display: block;
    animation: slideDown 0.25s ease;
}

input[type="password"],
input[type="text"].pw-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: var(--ease);
    font-family: inherit;
}

input[type="password"]:focus,
input[type="text"].pw-input:focus {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface-solid);
}

input[type="password"]::placeholder {
    color: var(--text-dim);
}

/* ─── Fortschritt ─── */

.progress-wrap {
    width: 100%;
    display: none;
}

.progress-wrap.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--inset);
    border: 1px solid var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.progress-bar {
    height: 100%;
    background: var(--grad-accent);
    border-radius: 99px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 12px rgba(139, 124, 255, 0.6);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ════════════════════════════ Ergebnis ════════════════════════════ */

.result {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
}

.result.visible {
    display: flex;
    animation: fadeIn 0.4s ease;
}

.result-checkmark {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--success-soft);
    border: 1px solid rgba(68, 224, 160, 0.3);
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    color: var(--success);
    box-shadow: 0 0 30px -6px rgba(68, 224, 160, 0.5);
}

.result h2 {
    font-size: 1.2rem;
}

.link-box {
    width: 100%;
    display: flex;
    gap: 0.5rem;
}

.link-box input {
    flex: 1;
    min-width: 0;
    padding: 0.8rem 1rem;
    background: var(--inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.8rem;
    font-family: var(--mono);
    outline: none;
}

.btn-copy {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--ease);
    flex-shrink: 0;
}

.btn-copy:hover {
    border-color: var(--accent-line);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-copy.copied {
    color: var(--success);
    border-color: var(--success);
    background: var(--success-soft);
}

.result-meta {
    font-size: 0.76rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.7;
}

.result-meta span {
    color: var(--text-muted);
}

/* ─── Download-Code (Ergebnis) ─── */

.code-display {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    background:
        radial-gradient(120% 140% at 50% 0%, rgba(139, 124, 255, 0.08), transparent 70%),
        var(--inset);
    border: 1px dashed var(--accent-line);
    border-radius: var(--radius);
}

.code-display .code-label {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    flex-shrink: 0;
}

.code-display .code-value {
    flex: 1;
    text-align: center;
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-left: 0.3em;
}

.code-hint {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: -0.4rem;
    line-height: 1.5;
}

/* ════════════════════════════ Code-Eingabe-Karte ════════════════════════════ */

.code-card {
    gap: 0.95rem;
}

.code-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.code-card-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -0.55rem;
}

.code-form {
    width: 100%;
    display: flex;
    gap: 0.5rem;
}

.code-form input {
    flex: 1;
    min-width: 0;
    padding: 0.8rem 1rem;
    background: var(--inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--mono);
    font-size: 1.2rem;
    letter-spacing: 0.25em;
    text-align: center;
    outline: none;
    transition: var(--ease);
}

.code-form input::placeholder {
    color: var(--text-dim);
    letter-spacing: 0.25em;
}

.code-form input:focus {
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface-solid);
}

.code-form .btn {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
    padding-left: 1.6rem;
    padding-right: 1.6rem;
}

.code-error {
    font-size: 0.78rem;
    color: var(--error);
    text-align: center;
    margin: 0;
}

/* ════════════════════════════ Download-Seite ════════════════════════════ */

.status-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
}

.error-icon {
    background: var(--error-soft);
    color: var(--error);
    border: 1px solid rgba(255, 107, 129, 0.3);
    box-shadow: 0 0 30px -8px rgba(255, 107, 129, 0.5);
}

.success-icon {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(68, 224, 160, 0.3);
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 0 30px -8px rgba(68, 224, 160, 0.5);
}

.lock-icon {
    background: var(--accent-soft);
    border: 1px solid var(--border);
    font-size: 1.5rem;
    box-shadow: var(--glow);
}

.file-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem 1rem;
}

.file-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 0.85rem;
}

.file-info-row:last-child {
    border-bottom: none;
}

.file-info-row .label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.file-info-row .value {
    color: var(--text);
    font-weight: 600;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info-row .timer {
    color: var(--accent-2);
    font-family: var(--mono);
}

.error-message {
    color: var(--error);
    font-size: 0.86rem;
    text-align: center;
}

.password-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

/* ════════════════════════════ Footer ════════════════════════════ */

footer {
    margin-top: auto;
    padding-top: 1.5rem;
    text-align: center;
}

footer p {
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

footer p::before {
    content: '🛡';
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ════════════════════════════ Animationen ════════════════════════════ */

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

.card { animation: fadeIn 0.5s ease-out both; }
.code-card { animation-delay: 0.08s; }

.uploading .progress-bar {
    animation: pulse 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ════════════════════════════ Responsive ════════════════════════════ */

@media (max-width: 600px) {
    .container {
        padding: 1.75rem 1rem 1.5rem;
        gap: 1.1rem;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .logo {
        justify-content: center;
    }

    .auth-box {
        max-width: none;
    }

    .card {
        padding: 1.4rem;
        border-radius: var(--radius);
    }

    .dropzone {
        padding: 2.25rem 1rem;
    }

    .card-title {
        font-size: 1.2rem;
    }
}
