/* ============================================
   File Encryption Web — Design System
   ============================================ */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #141826;
    --bg-card: rgba(20, 24, 38, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #e4e8f0;
    --text-secondary: #8892a8;
    --text-muted: #505a70;
    --accent: #10b981;
    --accent-2: #06b6d4;
    --accent-glow: rgba(16, 185, 129, 0.25);
    --error: #f87171;
    --warning: #fbbf24;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, sans-serif;
}

[data-theme="light"] {
    --bg-primary: #f0fdf4;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-primary: #1a1f36;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
}

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

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 500px 400px at 50% 30%, rgba(16, 185, 129, 0.05), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.app {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.header {
    padding: 16px 0 8px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: var(--radius);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 700;
}

.tagline {
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.icon-btn:hover {
    color: var(--accent);
}

.icon {
    width: 18px;
    height: 18px;
}

.moon-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon {
    display: block;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    width: 100%;
    justify-content: center;
}

.section {
    margin-bottom: 16px;
}

.label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
}

/* Mode Toggle */
.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 4px;
}

.mode-btn {
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}

/* Upload */
.upload-zone {
    padding: 32px;
    background: var(--bg-card);
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
}

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

.upload-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* File Card */
.file-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
}

.file-icon {
    font-size: 1.8rem;
}

.file-name {
    font-size: 0.86rem;
    font-weight: 600;
}

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

/* Password */
.password-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.password-row input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.84rem;
}

.password-row input:focus {
    outline: none;
    border-color: var(--accent);
}

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

.strength-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.strength-label {
    font-size: 0.66rem;
    color: var(--text-muted);
}

/* Progress */
.progress-wrap {
    margin-top: 10px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    width: 0;
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
}

/* Result */
.result-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    text-align: center;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(16px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.result-msg {
    font-size: 0.88rem;
    margin-bottom: 14px;
    color: var(--text-secondary);
}

/* Notice */
.notice {
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-sm);
}

.notice p {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.82rem;
    opacity: 0;
    transition: all 0.35s ease;
    z-index: 100;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hidden {
    display: none !important;
}