/* AF File Share: front end. Brand colours and font arrive as CSS variables from the settings page. */

.aft-body { margin: 0; background: #030d11; }

.aft-wrap {
    --aft-primary: #00B8B0;
    --aft-dark: #071F26;
    --aft-accent: #7CF5E8;
    --aft-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --aft-ink: #ecfbfa;
    --aft-mute: rgba(236, 251, 250, .66);
    --aft-line: rgba(236, 251, 250, .16);
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 22px;
    padding: clamp(18px, 5vw, 56px);
    font-family: var(--aft-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--aft-ink);
    background:
        radial-gradient(900px 420px at 88% -8%, color-mix(in srgb, var(--aft-primary) 38%, transparent), transparent 62%),
        linear-gradient(165deg, var(--aft-dark), #030d11 90%);
}
.aft-wrap *, .aft-wrap *::before, .aft-wrap *::after { box-sizing: border-box; }
.aft-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--aft-bg-image, none) center / cover no-repeat;
    opacity: .22;
    pointer-events: none;
}
.aft-page { border-radius: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.aft-inner { position: relative; width: 100%; max-width: 720px; margin: 0 auto; }

.aft-brand { margin-bottom: 22px; }
.aft-logo { display: block; max-height: 44px; width: auto; }
.aft-brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }

.aft-card {
    background: rgba(255, 255, 255, .055);
    border: 1px solid var(--aft-line);
    border-radius: 18px;
    padding: clamp(18px, 4vw, 34px);
    backdrop-filter: blur(10px);
}
.aft-card[hidden], .aft-view[hidden], .aft-wrap [hidden] { display: none !important; }

.aft-headline { margin: 0 0 6px; font-size: clamp(1.7rem, 4.4vw, 2.5rem); line-height: 1.08; letter-spacing: -.025em; font-weight: 700; color: #fff; }
.aft-sub { margin: 0 0 22px; color: var(--aft-mute); }
.aft-meta { margin: 0 0 18px; color: var(--aft-mute); font-size: .92rem; }
.aft-note { margin: 0 0 18px; padding: 14px 16px; border-left: 3px solid var(--aft-primary); background: rgba(255, 255, 255, .05); border-radius: 0 10px 10px 0; white-space: pre-wrap; }

/* Drop zone: the one memorable element */
.aft-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 168px; padding: 24px; text-align: center; cursor: pointer;
    border: 2px dashed color-mix(in srgb, var(--aft-primary) 70%, transparent);
    border-radius: 16px;
    background-image: radial-gradient(color-mix(in srgb, var(--aft-primary) 28%, transparent) 1px, transparent 1.4px);
    background-size: 18px 18px;
    transition: background-color .18s, border-color .18s, transform .18s;
}
.aft-drop strong { font-size: 1.3rem; color: #fff; }
.aft-drop span { color: var(--aft-mute); font-size: .92rem; }
.aft-drop:hover, .aft-drop.aft-over { background-color: color-mix(in srgb, var(--aft-primary) 16%, transparent); border-color: var(--aft-accent); }
.aft-drop.aft-over { transform: scale(1.01); }
.aft-drop:focus-visible, .aft-btn:focus-visible, .aft-wrap input:focus-visible, .aft-wrap textarea:focus-visible, .aft-wrap select:focus-visible { outline: 3px solid var(--aft-accent); outline-offset: 2px; }

.aft-files, .aft-dl { list-style: none; margin: 14px 0 0; padding: 0; }
.aft-files li, .aft-dl li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--aft-line); }
.aft-fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aft-fsize { color: var(--aft-mute); font-size: .9rem; white-space: nowrap; }
.aft-remove { background: none; border: 0; color: var(--aft-mute); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 8px; }
.aft-remove:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.aft-total { margin: 10px 0 0; color: var(--aft-mute); font-size: .92rem; }
.aft-ext { flex: none; min-width: 48px; padding: 5px 8px; text-align: center; font-size: .78rem; font-weight: 700; border-radius: 8px; color: var(--aft-dark); background: var(--aft-accent); }

/* Fields */
.aft-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0; }
.aft-field { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--aft-mute); }
.aft-wide { grid-column: 1 / -1; }
.aft-wrap input[type=text], .aft-wrap input[type=email], .aft-wrap input[type=password], .aft-wrap input[type=number], .aft-wrap textarea, .aft-wrap select {
    width: 100%; padding: 11px 13px; font: inherit; color: #fff;
    background: rgba(0, 0, 0, .28); border: 1px solid var(--aft-line); border-radius: 10px;
}
.aft-wrap select option { color: #111; }
.aft-honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.aft-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 24px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
    color: var(--aft-dark); background: var(--aft-primary); border: 0; border-radius: 12px;
    transition: filter .15s, transform .15s;
}
.aft-btn:hover { filter: brightness(1.1); }
.aft-btn:active { transform: translateY(1px); }
.aft-btn[disabled] { opacity: .4; cursor: not-allowed; filter: none; }
.aft-ghost { background: transparent; color: var(--aft-ink); border: 1px solid var(--aft-line); }
.aft-small { padding: 8px 16px; font-size: .9rem; }
.aft-go { width: 100%; font-size: 1.05rem; }

.aft-error { display: none; margin-top: 14px; padding: 11px 14px; border-radius: 10px; background: rgba(255, 99, 99, .14); border: 1px solid rgba(255, 130, 130, .5); color: #ffd4d4; }

/* Progress and done */
.aft-bar { height: 12px; margin: 22px 0 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.aft-bar-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--aft-primary), var(--aft-accent)); transition: width .25s ease-out; }
.aft-status { margin: 0 0 20px; color: var(--aft-mute); min-height: 1.5em; }
.aft-linkrow { display: flex; gap: 10px; margin: 0 0 18px; }
.aft-linkrow input { flex: 1; min-width: 0; }
.aft-pwform { display: flex; gap: 10px; flex-wrap: wrap; }
.aft-pwinput { flex: 1; min-width: 200px; width: auto; padding: 11px 13px; font: inherit; color: #fff; background: rgba(0, 0, 0, .28); border: 1px solid var(--aft-line); border-radius: 10px; }
.aft-footer { margin: 18px 0 0; text-align: center; font-size: .82rem; color: var(--aft-mute); }

@media (max-width: 560px) {
    .aft-fields { grid-template-columns: 1fr; }
    .aft-linkrow { flex-direction: column; }
    .aft-dl li { flex-wrap: wrap; }
    .aft-dl .aft-fname { flex-basis: calc(100% - 70px); }
}
@media (prefers-reduced-motion: reduce) {
    .aft-wrap * { transition: none !important; }
}

/* ---------- Background picker ---------- */
.aft-bgwrap { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.aft-bgpick { display: flex; flex-wrap: wrap; gap: 10px; }
.aft-bg { position: relative; display: block; width: 104px; height: 64px; border-radius: 10px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: rgba(0, 0, 0, .3); }
.aft-bg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.aft-bg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aft-bg-default span { display: flex; align-items: center; justify-content: center; height: 100%; font-size: .85rem; color: var(--aft-mute); background: linear-gradient(160deg, var(--aft-dark), #030d11); }
.aft-bg:has(input:checked) { border-color: var(--aft-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--aft-accent) 40%, transparent); }
.aft-bg:has(input:focus-visible) { outline: 3px solid var(--aft-accent); outline-offset: 2px; }
.aft-donebtns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Download page hero ---------- */
html { scroll-behavior: smooth; }
.aft-hero-page { display: block; padding: 0; border-radius: 0; overflow: visible; min-height: 100vh; }
.aft-hero-page::before { position: fixed; opacity: 1; z-index: 0; }
.aft-hero-page::after {
    content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(3, 13, 17, .5) 0, rgba(3, 13, 17, 0) 26%, rgba(3, 13, 17, 0) 60%, rgba(3, 13, 17, .55) 100%);
}
.aft-hero, .aft-details { position: relative; z-index: 1; }

.aft-hero { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; padding: clamp(16px, 3vw, 32px) clamp(18px, 4vw, 44px); }
.aft-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.aft-topbar .aft-brand { margin: 0; }
.aft-topbar .aft-logo { filter: drop-shadow(0 1px 8px rgba(0, 0, 0, .35)); }
.aft-topbar .aft-brand-name { text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.aft-pill { flex: none; white-space: nowrap; padding: 9px 20px; border-radius: 99px; background: #fff; color: #10242a; font-weight: 600; font-size: .95rem; text-decoration: none; transition: transform .15s; }
.aft-pill:hover { transform: translateY(-1px); }
.aft-pill:focus-visible, .aft-scroll:focus-visible, .aft-bigdl:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.aft-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 0; }

.aft-bubble {
    position: relative; width: min(320px, 86vw); padding: 16px 20px; border-radius: 10px;
    background: #fff; color: #17282d; box-shadow: 0 10px 40px rgba(0, 0, 0, .28);
}
.aft-bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 16px; height: 16px; background: #fff; transform: translateX(-50%) rotate(45deg); }
.aft-bubble p { margin: 0; }
.aft-bubble-hint { font-size: 1.05rem; }
.aft-bubble-title { margin-top: 12px !important; font-weight: 800; font-size: 1.1rem; overflow-wrap: anywhere; }
.aft-bubble-meta { margin-top: 2px !important; color: #6a7a7f; font-size: .98rem; }

.aft-bigdl {
    display: flex; align-items: center; justify-content: center; margin-top: 26px;
    width: clamp(124px, 22vw, 156px); aspect-ratio: 1; border-radius: 50%;
    background: var(--aft-button, var(--aft-primary)); color: #fff; text-decoration: none;
    border: 6px solid #fff;
    box-shadow: 0 0 0 16px rgba(255, 255, 255, .2), 0 14px 40px rgba(0, 0, 0, .3);
    transition: transform .18s;
}
.aft-bigdl svg { width: 46%; height: 46%; }
.aft-bigdl:hover { transform: scale(1.05); }
.aft-until { margin: 34px 0 0; font-size: .95rem; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }

.aft-scroll {
    align-self: center; display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #17282d;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25); text-decoration: none;
}

.aft-details { padding: clamp(24px, 6vw, 72px) clamp(18px, 4vw, 44px) clamp(40px, 8vw, 96px); }
.aft-details .aft-card { max-width: 720px; margin: 0 auto; }
.aft-h2 { font-size: clamp(1.5rem, 3.6vw, 2rem); }

@media (prefers-reduced-motion: no-preference) {
    .aft-bigdl { animation: aft-halo 3.2s ease-in-out infinite; }
    @keyframes aft-halo {
        0%, 100% { box-shadow: 0 0 0 16px rgba(255, 255, 255, .2), 0 14px 40px rgba(0, 0, 0, .3); }
        50% { box-shadow: 0 0 0 26px rgba(255, 255, 255, .1), 0 14px 40px rgba(0, 0, 0, .3); }
    }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Dashboard Send files screen ---------- */
.aft-send-page { max-width: 820px; margin: 22px 20px 22px 0; }

/* ---------- Short link box (Send files screen) ---------- */
.aft-short { margin: 22px 0; padding-top: 18px; border-top: 1px solid var(--aft-line); }
.aft-h3 { margin: 0 0 10px; font-size: 1.05rem; color: #fff; }
.aft-short-form { display: flex; flex-wrap: wrap; gap: 10px; }
.aft-short-form select { flex: 0 1 220px; }
.aft-short-form input { flex: 1 1 180px; min-width: 0; }
.aft-sm-msg { min-height: 1.4em; margin: 10px 0; color: var(--aft-mute); }
.aft-sm-ok { color: var(--aft-accent); }
.aft-sm-err { color: #ffd4d4; }
