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

:root {
    --bg: #09090b;
    --surface: #18181b;
    --surface-hover: #1f1f23;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #fafafa;
    --text-dim: #71717a;
    --text-muted: #52525b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-dim: rgba(59, 130, 246, 0.08);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.08);
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.08);
    --warning: #eab308;
    --warning-dim: rgba(234, 179, 8, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--accent-hover);
}

/* ── Card ── */
.card {
    width: 100%;
    max-width: 480px;
    padding: 40px;
    animation: fadeIn 0.4s ease;
}

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

/* ── Header ── */
.header {
    text-align: center;
    margin-bottom: 36px;
}

.header-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.header-sub {
    font-size: 0.875rem;
    color: var(--text-dim);
}

/* ── Divider ── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}

/* ── Form ── */
.field {
    margin-bottom: 20px;
}

.field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 0.9375rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.input:focus {
    border-color: var(--accent);
}

.input::placeholder {
    color: var(--text-muted);
}

.input-code {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 1.25rem;
    text-align: center;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    height: 52px;
}

/* ── Pill Buttons (expiry) ── */
.pill-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pill {
    height: 36px;
    padding: 0 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-dim);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.pill:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Toggle ── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-dim);
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--text-muted);
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    padding: 0;
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle.on {
    background: var(--accent);
}

.toggle.on::after {
    transform: translateX(18px);
}

.password-field {
    margin-top: 12px;
    display: none;
}

.password-field.show {
    display: block;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: var(--danger-dim);
}

.btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: 0.8125rem;
    border-radius: var(--radius-xs);
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ── Dropzone ── */
.dropzone {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.dropzone:hover,
.dropzone.active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.dropzone-icon {
    font-size: 1.5rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

.dropzone-text {
    font-size: 0.9375rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

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

/* ── Progress ── */
.progress-wrap {
    margin-top: 20px;
    display: none;
}

.progress-wrap.show {
    display: block;
}

.progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.8125rem;
    color: var(--text-dim);
}

.progress-text span {
    color: var(--text);
    font-weight: 500;
}

/* ── Result ── */
.result {
    display: none;
}

.result.show {
    display: block;
}

.result-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--success-dim);
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--success);
    margin-bottom: 16px;
}

.link-box {
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    word-break: break-all;
    line-height: 1.6;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.link-box .key-part {
    color: var(--accent);
}

.result-warning {
    font-size: 0.8125rem;
    color: var(--warning);
    line-height: 1.5;
}

/* ── File List ── */
.file-list {
    margin-bottom: 20px;
}

.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

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

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

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

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

.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 12px;
}

/* ── Transfer Header ── */
.transfer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.transfer-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.05em;
}

.transfer-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ── Empty State ── */
.empty {
    text-align: center;
    padding: 24px 0;
}

.empty-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
    opacity: 0.4;
}

.empty-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    font-weight: 500;
    z-index: 9999;
    animation: toastIn 0.25s ease;
    pointer-events: none;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast-success {
    background: var(--success);
    color: #000;
}

.toast-error {
    background: var(--danger);
    color: #fff;
}

.toast-info {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

/* ── Nav ── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px;
    gap: 12px;
    z-index: 100;
}

.nav-link {
    font-size: 0.8125rem;
    color: var(--text-muted);
    transition: color 0.15s;
}

.nav-link:hover {
    color: var(--text);
}

.lang-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.lang-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

/* ── Utility ── */
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8125rem; }
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 520px) {
    .card {
        padding: 28px 20px;
    }

    .pill-group {
        gap: 4px;
    }

    .pill {
        height: 32px;
        padding: 0 10px;
        font-size: 0.75rem;
    }

    .dropzone {
        padding: 36px 16px;
    }

    .file-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .file-actions {
        margin-left: 0;
    }
}
