* { box-sizing: border-box; }
body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e8e8e8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-x: hidden;
}
.home-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -8rem;
    max-width: 100%;
    width: 100%;
}
.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem clamp(1rem, 4vw, 2rem);
    margin-top: 1.25rem;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
    max-width: 640px;
}
.site-nav a {
    color: #e8e8e8;
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
}
.site-nav a:hover { color: #7dd3fc; }
.site-nav a.active { color: #7dd3fc; }
.site-nav a { display: inline-flex; align-items: center; gap: 0.4rem; }
.site-nav .nav-icon { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.site-nav .nav-logo-link { margin-right: 0.25rem; }
.site-nav .nav-logo { height: 2rem; width: auto; display: block; max-height: 2rem; }
.home-info {
    max-width: 520px;
    width: 100%;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1.1rem;
    background: rgba(125, 211, 252, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.25);
    border-radius: 12px;
    color: #e8e8e8;
    font-size: clamp(0.85rem, 2.2vw, 0.95rem);
    line-height: 1.45;
    text-align: center;
}
.home-info strong { color: #7dd3fc; }
input[type="file"] { display: none; }
input[type="submit"] { display: none; }
.custom-file-upload {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    cursor: pointer;
    min-width: 180px;
    border-radius: 16px;
    margin: 8px;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 600;
    color: #e8e8e8;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-left: 4px solid transparent;
}
.custom-file-upload:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(125, 211, 252, 0.35);
    border-left-color: #7dd3fc;
    color: #7dd3fc;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}
.custom-file-upload .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.custom-file-upload .btn-icon svg { width: 1.35rem; height: 1.35rem; }
.upload:hover { background: rgba(125, 211, 252, 0.12); border-left-color: #7dd3fc; color: #7dd3fc; }
#body {
    visibility: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(1rem, 4vw, 2rem);
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 1rem;
    box-sizing: border-box;
}
.progress-wrap {
    width: 100%;
    max-width: min(90vw, 360px);
    margin: 0 auto;
    padding: 0 0.25rem;
}
.progress-wrap .label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: clamp(0.875rem, 2.5vw, 0.95rem);
    color: #e8e8e8;
}
.progress-track {
    height: clamp(8px, 2.5vw, 12px);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7dd3fc, #38bdf8);
    border-radius: 999px;
    transition: width 0.15s ease-out;
}
.main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 0.75rem;
    width: 100%;
    max-width: 620px;
}
.main form {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.upload-dropzone {
    width: 100%;
    min-height: 260px;
    border: 2px dashed rgba(125, 211, 252, 0.75);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(125, 211, 252, 0.22) 0%, rgba(56, 189, 248, 0.2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1.25rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.upload-dropzone:hover,
.upload-dropzone.drag-active {
    border-color: #7dd3fc;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}
.dropzone-icon {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 0.75rem;
    opacity: 0.95;
}
.dropzone-title {
    font-size: clamp(1.2rem, 2.8vw, 2rem);
    font-weight: 300;
    color: #e8e8e8;
}
.dropzone-or {
    margin-top: 0.6rem;
    margin-bottom: 0;
    font-size: 1.15rem;
    font-weight: 300;
    color: #7dd3fc;
}
.selected-count {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.92;
}
.upload-action-btn {
    border: 0;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    min-width: 170px;
    background: #38bdf8;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.upload-action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.upload-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.selected-files-wrap {
    width: 100%;
    max-width: 560px;
}
ul {
    margin: 0;
    padding-left: 1.1rem;
    color: #e8e8e8;
    font-size: clamp(0.75rem, 2vw, 1rem);
    text-align: left;
}
.spinner {
    --t: 2500ms;
    --animation: rotate var(--t) linear infinite;
    --animation2: scale var(--t) linear infinite alternate;
    position: relative;
    width: clamp(6rem, 20vw, 10rem);
    height: clamp(6rem, 20vw, 10rem);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: var(--animation), var(--animation2);
}
.spinner::before, .spinner::after { content: ""; position: absolute; }
.spinner::before {
    inset: 0;
    border: 3px solid #7dd3fc;
    border-radius: 50%;
    mask-image: conic-gradient(transparent 10%, black);
    animation: borderScale var(--t) linear infinite alternate;
}
.spinner::after {
    --r: 45deg;
    --scale: 2;
    width: 20%;
    height: 20%;
    background:
        radial-gradient(circle at 30% 35%, #e8e8e8 3px, transparent 0),
        radial-gradient(circle at 70% 35%, #e8e8e8 3px, transparent 0),
        radial-gradient(circle at top center, #e8e8e8 6px, transparent 0),
        #7dd3fc;
    background-position: 0 0, 0 0, 0 1.25rem;
    top: 0;
    translate: 0 -50%;
    rotate: 45deg;
    animation: var(--animation) reverse, var(--animation2);
    border-radius: 20%;
}
@keyframes rotate { to { rotate: calc(360deg + var(--r, 0deg)); } }
@keyframes scale { to { scale: var(--scale, 0.5); } }
@keyframes borderScale { to { border: 6px solid #7dd3fc; } }
@media screen and (min-width: 1000px) {
    .custom-file-upload {
        min-width: 220px;
        padding: 1.5rem 2.25rem;
        font-size: 1.2rem;
    }
}
@media screen and (max-width: 600px) {
    .home-wrap { margin-top: -4rem; }
    .site-nav { gap: 0.75rem; padding: 0.5rem 1rem; }
    .site-nav .nav-logo { height: 1.5rem; }
    .custom-file-upload {
        min-width: 140px;
        padding: 1rem 1.5rem;
        font-size: clamp(0.9rem, 3.5vw, 1.1rem);
    }
    .main { margin-top: 1.5rem; }
    #body .spinner { width: clamp(5rem, 22vw, 8rem); height: clamp(5rem, 22vw, 8rem); }
    .progress-wrap { max-width: 94vw; }
    .upload-dropzone { min-height: 220px; }
}
@media screen and (max-width: 380px) {
    body { padding: 0.5rem; }
    .custom-file-upload {
        min-width: 120px;
        padding: 0.85rem 1.25rem;
        margin: 6px;
        font-size: clamp(0.8rem, 3vw, 1rem);
    }
    .main { flex-direction: column; }
    #body { padding: 0.75rem; }
    #body .spinner { width: 4.5rem; height: 4.5rem; }
    .progress-wrap .label { font-size: 0.8125rem; }
}
@media screen and (max-width: 1000px) {
    .spinner::after {
        --r: 45deg;
        --scale: 2;
        width: 20%;
        height: 20%;
        background: radial-gradient(circle at 30% 50%, #e8e8e8 8px, transparent 0),
            radial-gradient(circle at 70% 50%, #e8e8e8 8px, transparent 0),
            radial-gradient(circle at 50% -3%, #e8e8e8 28px, transparent 0),
            #7dd3fc;
        background-position: 0 0, 0 0, 0 1.25rem;
        top: 0;
        translate: 0 -50%;
        rotate: 45deg;
        animation: var(--animation) reverse, var(--animation2);
        border-radius: 20%;
    }
    .spinner {
        --t: 2500ms;
        width: 40rem;
        height: 40rem;
        display: flex;
        justify-content: center;
        align-items: center;
        animation: var(--animation), var(--animation2);
    }
    .spinner::before {
        inset: 0;
        border: 3px solid #7dd3fc;
        border-radius: 50%;
        mask-image: conic-gradient(transparent 10%, black);
        animation: borderScale var(--t) linear infinite alternate;
    }
}
.home-encrypt-modal, .home-pin-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.home-encrypt-modal.is-open, .home-pin-modal.is-open { display: flex; }
.home-encrypt-card, .home-pin-card {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.home-encrypt-card h2, .home-pin-card h2 { margin: 0 0 0.75rem 0; font-size: 1.1rem; color: #fff; }
.home-encrypt-card p, .home-pin-card p { margin: 0 0 1rem 0; font-size: 0.95rem; opacity: 0.9; }
.home-modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.home-modal-btn { padding: 0.5rem 1.25rem; border-radius: 10px; font-size: 0.95rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.home-modal-btn-secondary { background: rgba(255, 255, 255, 0.08); color: #e8e8e8; }
.home-modal-btn-primary { background: #7dd3fc; color: #1a1a2e; }
.home-pin-card input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: #e8e8e8;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}
.home-pin-card .home-pin-error { color: #fca5a5; font-size: 0.85rem; margin-bottom: 0.5rem; }
