:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --bg1: #0f172a;
    --bg2: #312e81;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #d1d5db;
    --danger: #dc2626;
    --success: #16a34a;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg1), var(--bg2)) fixed;
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.card {
    background: #fff;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
    animation: rise .4s ease;
}

.brand { text-align: center; margin-bottom: 20px; }
.brand h1 { margin: 6px 0 2px; font-size: 1.8rem; }
.brand p { margin: 0; color: var(--muted); }
.logo {
    width: 56px; height: 56px; margin: 0 auto; border-radius: 16px;
    display: grid; place-items: center; font-size: 1.8rem; color: #fff;
    background: linear-gradient(135deg, var(--primary), #9333ea);
}

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.field em { font-weight: 400; color: var(--muted); }

input[type=text], textarea {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    font-size: 16px; /* prevents iOS zoom on focus */
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .2);
}
.invalid { border-color: var(--danger) !important; }

.dropzone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 22px 12px;
    text-align: center;
    transition: all .2s;
    background: #fafafa;
}
.dropzone.dragover { border-color: var(--primary); background: #eef2ff; transform: scale(1.01); }
.dropzone p { margin: 4px 0; }
.dz-icon { font-size: 2.2rem; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }

.file-list { list-style: none; margin: 12px 0 0; padding: 0; }
.file-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: 12px; background: #f3f4f6; margin-bottom: 6px;
    animation: rise .25s ease;
}
.file-list .thumb {
    width: 44px; height: 44px; border-radius: 8px; flex: none;
    background: #e5e7eb center / cover no-repeat;
    display: grid; place-items: center; font-size: 1.2rem;
}
.file-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.file-list .size { color: var(--muted); font-size: .75rem; }
.file-list button {
    border: 0; background: none; font-size: 1.4rem; line-height: 1;
    color: var(--muted); padding: 6px 10px; cursor: pointer;
}
.summary { font-size: .85rem; color: var(--muted); margin: 6px 2px 0; }
.summary.over { color: var(--danger); font-weight: 600; }

.error {
    margin-top: 14px; padding: 10px 14px; border-radius: 12px;
    background: #fef2f2; color: var(--danger); font-size: .9rem;
    animation: shake .35s;
}

.btn {
    font: inherit; font-weight: 600; border: 0; border-radius: 12px;
    padding: 12px 20px; cursor: pointer; transition: transform .1s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { width: 100%; margin-top: 18px; background: var(--primary); color: #fff; font-size: 1.05rem; padding: 14px; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary { background: #e0e7ff; color: var(--primary-dark); margin-top: 4px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.progress-wrap { margin-top: 18px; }
.progress-label { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.progress { height: 14px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.progress-bar {
    height: 100%; width: 0; border-radius: 999px; transition: width .15s linear;
    background: linear-gradient(90deg, var(--primary), #9333ea, var(--primary));
    background-size: 200% 100%; animation: slide 1.2s linear infinite;
}

.thanks { text-align: center; padding: 40px 20px; }
.thanks:not([hidden]) { animation: pop .6s cubic-bezier(.2, 1.4, .4, 1); }
.thanks h2 { font-size: 2.2rem; margin: 12px 0 4px; }
.thanks p { color: var(--muted); margin: 0 0 8px; }
.check { width: 96px; height: 96px; }
.check-circle { stroke: var(--success); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s .1s forwards; }
.check-mark { stroke: var(--success); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .6s forwards; }

[hidden] { display: none !important; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes slide { to { background-position: -200% 0; } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.dropzone .file-list { text-align: left; margin-top: 16px; }
.dropzone .summary { text-align: center; }

