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

:root {
    --bg: #f8f9fb;
    --surface: #ffffff;
    --border: #e2e5ea;
    --text: #1a1d23;
    --text-secondary: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff4ff;
    --success: #059669;
    --success-light: #ecfdf5;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(37, 99, 235, 0.03) 0%, transparent 50%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.2));
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    margin-bottom: 0;
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 20px;
}

h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 28px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Login icon */
.login-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.login-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
    opacity: 0.7;
}

#login-section h2 {
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--surface);
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    width: 100%;
    margin-top: 4px;
}

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

.btn-secondary {
    background: var(--accent-light);
    color: var(--accent);
}

.btn-secondary:hover {
    background: #dde6fd;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
}

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

.btn-danger {
    background: transparent;
    color: var(--danger);
    padding: 4px 8px;
}

.btn-danger:hover {
    background: #fef2f2;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.drop-icon {
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.drop-zone p {
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 500;
}

.drop-hint {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin: 8px 0;
}

.size-limit {
    color: var(--text-secondary) !important;
    font-size: 0.8125rem !important;
    font-weight: 400 !important;
    margin-top: 12px;
}

/* Progress */
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

#progress-filename {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 50%, var(--accent) 100%);
    background-size: 200% 100%;
    animation: progress-shimmer 1.5s ease infinite;
    border-radius: 3px;
    width: 0%;
    transition: width 0.2s;
}

@keyframes progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Success box */
.success-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--success-light);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.check-icon {
    width: 20px;
    height: 20px;
    color: var(--success);
    flex-shrink: 0;
    margin-top: 2px;
}

.success-content {
    flex: 1;
    min-width: 0;
}

.success-content p {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--success);
    margin-bottom: 8px;
}

.url-box {
    display: flex;
    gap: 8px;
}

.url-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: #fff;
    min-width: 0;
}

.url-box input:focus {
    outline: none;
}

/* File list */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    font-size: 0.875rem;
    transition: background 0.1s;
}

.file-item:hover {
    background: var(--bg);
}

.file-icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex-shrink: 0;
    opacity: 0.7;
}

.file-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.file-item-size {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.file-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

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

/* Error */
.error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

/* Footer */
footer {
    text-align: center;
    padding: 32px 0 16px;
}

footer p {
    font-size: 0.75rem;
    color: var(--border);
    letter-spacing: 0.02em;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 20px 16px;
    }

    .card {
        padding: 24px 20px;
    }

    .drop-zone {
        padding: 32px 16px;
    }

    .url-box {
        flex-direction: column;
    }

    .file-item {
        flex-wrap: wrap;
    }

    .file-item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 4px;
    }
}
