* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
.bg-decor {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(20, 184, 166, 0.10), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.08), transparent 50%);
}
.page {
    position: relative; z-index: 1;
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    padding: 36px 32px;
}
.state { text-align: center; padding: 12px 0; }
.state.hidden { display: none; }
.spinner {
    width: 42px; height: 42px; margin: 0 auto 14px;
    border: 3px solid #e2e8f0;
    border-top-color: #14B8A6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-wrap {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff;
}
.icon-error  { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.icon-locked { background: linear-gradient(135deg, #f59e0b, #b45309); }
h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.muted { color: #64748b; font-size: 0.95rem; }
.small { font-size: 0.82rem; }
.center { text-align: center; }
.hidden { display: none !important; }

.header-row {
    display: flex;
    align-items: center;
    gap: 18px;
    text-align: left;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid #f1f5f9;
}
.file-icon-big {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #14B8A6, #0D9488);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.header-info { min-width: 0; }
.header-info h1 {
    margin-bottom: 4px;
    word-break: break-word;
}

.message-block {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
}
.message-block i { color: #14B8A6; margin-top: 3px; }
.message-block p { color: #334155; line-height: 1.5; white-space: pre-wrap; }

.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-radius: 12px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, background .2s;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, #14B8A6, #0D9488);
    color: #fff;
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(20, 184, 166, 0.50); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.form-inline {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}
.form-inline input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font: inherit;
    background: #fff;
}
.form-inline input:focus { outline: none; border-color: #14B8A6; box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }
.error { color: #b91c1c; margin-top: 10px; font-size: 0.9rem; }

#limits-note { margin-top: 16px; }

.footer {
    margin-top: 22px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.82rem;
}
.footer a { color: #64748b; text-decoration: none; }
.footer a:hover { color: #14B8A6; }

@media (max-width: 480px) {
    .card { padding: 26px 20px; border-radius: 14px; }
    .header-row { flex-direction: column; text-align: center; }
    .file-icon-big { margin: 0 auto; }
}
