* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

/* =========================
   LOGIN
========================= */

body:not(.filemanager-body) {
    min-height: 100vh;
    color: #fff;
    background: #0b0b0f;
    overflow-x: hidden;
}

body:not(.filemanager-body)::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    filter: blur(14px);
    transform: scale(1.08);
    z-index: -2;
}

body:not(.filemanager-body)::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: -1;
}

.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 520px;
    padding: 45px;
    border-radius: 28px;

    background: rgba(255,255,255,.10);

    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    border: 1px solid rgba(255,255,255,.15);

    box-shadow:
        0 20px 60px rgba(0,0,0,.35);

    animation: loginShow .8s ease;
}

.logo-box {
    text-align: center;
    margin-bottom: 25px;
}

.logo-box img {
    width: 260px;
    max-width: 100%;
    height: auto;
}

.login-card h1 {
    text-align: center;
    color: #fff;
    font-size: 34px;
    margin: 0 0 10px;
}

.subtitle {
    text-align: center;
    color: rgba(255,255,255,.85);
    font-size: 16px;
    margin-bottom: 35px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    height: 58px;

    border: 1px solid rgba(255,255,255,.15);
    border-radius: 18px;

    background: rgba(255,255,255,.12);

    color: #fff;
    font-size: 15px;

    padding: 0 18px;

    outline: none;
}

.form-group input:focus {
    border-color: rgba(255,255,255,.5);
    background: rgba(255,255,255,.18);
}

.form-group input::placeholder {
    color: rgba(255,255,255,.6);
}

/* PASSWORD */

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-right: 60px;
}

.toggle-password {
    position: absolute;

    top: 50%;
    right: 10px;

    transform: translateY(-50%);

    width: 38px !important;
    height: 38px !important;

    min-width: 38px;
    min-height: 38px;

    margin: 0 !important;
    padding: 0 !important;

    border: none !important;
    border-radius: 10px;

    background: rgba(255,255,255,.15);

    color: #fff;

    display: flex !important;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 10;
}

.toggle-password:hover {
    background: rgba(255,255,255,.25);
}

.remember-box {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 25px;

    color: #fff;
    cursor: pointer;
}

.remember-box input {
    width: 18px;
    height: 18px;
}

.remember-box span {
    font-size: 14px;
}

/* SOLO PULSANTE ACCEDI */

.login-card button[type="submit"] {

    width: 100%;

    height: 58px;

    border: none;

    border-radius: 18px;

    background: #fff;

    color: #111;

    font-size: 16px;
    font-weight: 800;

    cursor: pointer;

    transition: .2s;
}

.login-card button[type="submit"]:hover {
    transform: translateY(-2px);
}

.error-box {
    background: rgba(255,60,60,.18);
    border: 1px solid rgba(255,60,60,.35);

    color: #fff;

    padding: 14px;

    border-radius: 14px;

    margin-bottom: 20px;
}

@keyframes loginShow {

    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

}

body.filemanager-body {
    min-height: 100vh;
    background: #f5f6f8;
    color: #1f2937;
}

.fm-app {
    min-height: 100vh;
}

.fm-topbar {
    height: 66px;
    background: #fff;
    border-bottom: 1px solid #dde1e7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.fm-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.fm-brand img {
    width: 165px;
}

.fm-brand strong,
.fm-brand span {
    display: block;
}

.fm-brand strong {
    font-size: 18px;
}

.fm-brand span {
    font-size: 13px;
    color: #6b7280;
}

.fm-toolbar {
    height: 58px;
    background: #fbfbfc;
    border-bottom: 1px solid #dde1e7;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 26px;
    position: sticky;
    top: 66px;
    z-index: 19;
}

.fm-user button,
.fm-toolbar button,
.toolbar-link {
    width: auto;
    height: 40px;
    border: 1px solid #d7dce3;
    background: #fff;
    color: #1f2937;
    border-radius: 9px;
    padding: 0 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.fm-content {
    padding: 34px;
}

.fm-title {
    margin-bottom: 28px;
}

.fm-title h1 {
    margin: 0 0 8px;
    font-size: 34px;
    font-weight: 800;
    color: #111827;
}

.fm-title p {
    margin: 0;
    color: #6b7280;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 34px 28px;
}

.win-folder {
    text-align: center;
    text-decoration: none;
    color: #111827;
    padding: 8px;
    border-radius: 12px;
}

.win-folder:hover {
    background: #eaf2ff;
}

.folder-thumb {
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-icon-real {
    width: 110px;
    height: 76px;
    background: linear-gradient(#ffd96b, #ffc640);
    border-radius: 8px 8px 11px 11px;
    position: relative;
    box-shadow: inset 0 -8px 0 rgba(0,0,0,.04), 0 4px 10px rgba(0,0,0,.12);
}

.folder-icon-real::before {
    content: "";
    position: absolute;
    top: -17px;
    left: 0;
    width: 52px;
    height: 22px;
    background: #ffc221;
    border-radius: 8px 12px 0 0;
}

.folder-name {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.25;
    word-break: break-word;
}

.folder-count {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 34px 26px;
}

.win-file {
    position: relative;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
}

.win-file:hover {
    background: #eaf2ff;
}

.file-check {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    background: rgba(255,255,255,.9);
    border-radius: 6px;
    padding: 3px;
}

.file-check input {
    width: 18px;
    height: 18px;
}

.file-preview {
    height: 122px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #d5d9e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-preview img,
.file-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-name {
    margin-top: 9px;
    font-size: 14px;
    color: #111827;
    word-break: break-word;
}

.file-size {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.single-download {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #d7dce3;
    border-radius: 8px;
    color: #1f2937;
    font-size: 12px;
    text-decoration: none;
    font-weight: 700;
}

.fm-message {
    margin: 18px 34px 0;
    padding: 13px 16px;
    border-radius: 10px;
    font-weight: 700;
}

.fm-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.fm-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.empty-simple {
    padding: 70px 20px;
    text-align: center;
    color: #6b7280;
}

.empty-simple div {
    font-size: 70px;
}

.empty-simple h2 {
    color: #111827;
}

/* MODAL + MENU */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 90;
    display: none;
}

.overlay.show {
    display: block;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 20px 70px rgba(0,0,0,.25);
    position: relative;
}

.modal-card h2 {
    margin-top: 0;
    color: #111827;
}

.modal-card label,
.side-box label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.modal-card input,
.side-box input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    margin-bottom: 14px;
}

.modal-card button,
.side-box button {
    width: 100%;
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px !important;
    height: 34px;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #eef2f7 !important;
    color: #111827 !important;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -390px;
    width: 370px;
    max-width: 94vw;
    height: 100vh;
    background: #fff;
    z-index: 110;
    box-shadow: -18px 0 55px rgba(0,0,0,.22);
    transition: .22s ease;
    padding: 22px;
    overflow-y: auto;
}

.side-menu.show {
    right: 0;
}

.side-menu-head {
    position: relative;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.side-menu-head strong {
    display: block;
    font-size: 22px;
    color: #111827;
}

.side-menu-head span {
    color: #6b7280;
}

.side-menu-head button {
    position: absolute;
    top: 0;
    right: 0;
    border: none;
    background: #eef2f7;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
}

.side-box {
    margin-bottom: 24px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.side-box h3 {
    margin-top: 0;
    color: #111827;
}

.user-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.user-row strong {
    color: #111827;
}

.user-row span {
    color: #6b7280;
    font-size: 12px;
}

.logout-side {
    display: block;
    text-align: center;
    background: #ef4444;
    color: #fff;
    padding: 13px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 900;
}

@media (max-width: 700px) {
    .login-card {
        padding: 28px 22px;
    }

    .fm-brand img {
        width: 125px;
    }

    .fm-brand span {
        display: none;
    }

    .fm-toolbar {
        overflow-x: auto;
        padding: 0 14px;
    }

    .fm-content {
        padding: 22px 14px;
    }

    .folder-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 26px 16px;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 24px 14px;
    }

    .file-preview {
        height: 100px;
    }
	.single-download.danger,
.danger-btn {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: #ef4444 !important;
}

.chunk-drop {
    min-height: 150px;
    border: 2px dashed #9ca3af;
    border-radius: 16px;
    background: #f8fafc;
    color: #374151;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-align: center;
    margin-bottom: 18px;
}

.chunk-drop input {
    display: none;
}

.chunk-drop strong {
    font-size: 18px;
}

.chunk-drop span {
    font-size: 13px;
    color: #6b7280;
}

.chunk-drop.drag-over {
    background: #dbeafe;
    border-color: #2563eb;
}

.chunk-progress-area {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.chunk-row {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
}

.chunk-name {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    word-break: break-word;
}

.chunk-bar-wrap {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.chunk-bar {
    width: 0%;
    height: 100%;
    background: #2563eb;
    transition: width .15s ease;
}

.chunk-percent {
    margin-top: 6px;
    font-size: 12px;
    color: #4b5563;
    text-align: right;
}


}