/* =========================================================
   Simple File Transfer — Frontend Premium UI
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

/* ============== STAGE ============== */

.sft-stage {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.sft-stage__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.sft-stage__slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.sft-stage__slide.is-active {
    opacity: 1;
}

.sft-stage__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sft-stage__media--embed .sft-stage__embed {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.sft-stage__media--embed .sft-stage__embed iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 177.78vh;
    min-width: 100%;
    height: 100vh;
    min-height: 56.25vw;
    transform: translate(-50%, -50%);
    border: 0;
    pointer-events: none;
}

.sft-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.25));
    pointer-events: none;
    z-index: 1;
}

.sft-stage__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 2;
}

/* ============== HERO ============== */

.sft-hero {
    text-align: center;
    color: #fff;
}

.sft-hero__logo {
    max-width: 160px;
    max-height: 80px;
    margin-bottom: 18px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

.sft-hero__title {
    font-family: 'Fraunces', 'Times New Roman', Georgia, serif !important;
    font-size: 38px;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    color: #fff !important;
    line-height: 1.1;
    text-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.sft-hero__subtitle {
    font-size: 15px;
    margin: 0;
    color: rgba(255,255,255,0.92) !important;
    font-weight: 400;
    line-height: 1.4;
    text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

/* ============== APP CONTAINER ============== */

.sft-app {
    --sft-bg: #fafafa;
    --sft-surface: #ffffff;
    --sft-text: #09090b;
    --sft-text-secondary: #52525b;
    --sft-text-muted: #71717a;
    --sft-text-tertiary: #a1a1aa;
    --sft-border: #e4e4e7;
    --sft-border-strong: #d4d4d8;
    --sft-accent: #0ea5e9;
    --sft-accent-hover: #0284c7;
    --sft-accent-soft: #e0f2fe;
    --sft-success: #10b981;
    --sft-success-soft: #d1fae5;
    --sft-danger: #ef4444;
    --sft-danger-soft: #fee2e2;
    --sft-warning: #f59e0b;
    --sft-warning-soft: #fef3c7;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    color: var(--sft-text) !important;
    width: 100%;
    max-width: 480px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: block;
    margin: 0;
    box-sizing: border-box;
    text-align: left;
}

.sft-app *, .sft-app *::before, .sft-app *::after {
    box-sizing: border-box;
}

.sft-app a { color: var(--sft-accent); text-decoration: none; }
.sft-app p { margin: 0; }
.sft-app h1, .sft-app h2, .sft-app h3 { margin: 0; }
.sft-app ul, .sft-app ol { list-style: none; margin: 0; padding: 0; }

/* ============== UPGRADE BANNER ============== */

.sft-upgrade-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--sft-text) !important;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.sft-upgrade-banner__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.sft-upgrade-banner__text {
    flex: 1;
    line-height: 1.5;
}

.sft-upgrade-banner a {
    color: var(--sft-accent) !important;
    font-weight: 600;
    text-decoration: none !important;
    border-bottom: 1px solid currentColor;
    transition: color 0.15s;
}

.sft-upgrade-banner a:hover {
    color: var(--sft-accent-hover) !important;
}

/* ============== CARD ============== */

.sft-card {
    background: var(--sft-surface);
    border-radius: 20px;
    box-shadow:
        0 24px 48px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: relative;
}

/* ============== PANELS (stati) ============== */

.sft-panel {
    padding: 28px;
}

.sft-panel--dropzone {
    padding: 20px;
}

.sft-panel[hidden] { display: none !important; }

/* ============== DROPZONE ============== */

.sft-dropzone {
    border: 2px dashed var(--sft-border-strong);
    border-radius: 14px;
    padding: 44px 24px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    background: linear-gradient(180deg, #fafafa, #f4f4f5);
    position: relative;
}

.sft-dropzone:hover,
.sft-dropzone.is-dragover {
    border-color: var(--sft-accent);
    background: linear-gradient(180deg, #f0f9ff, #e0f2fe);
    transform: translateY(-1px);
}

.sft-dropzone__icon {
    color: var(--sft-accent);
    margin: 0 auto 14px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--sft-accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.sft-dropzone:hover .sft-dropzone__icon {
    transform: scale(1.05);
}

.sft-dropzone__icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.sft-dropzone__title {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: var(--sft-text) !important;
    margin: 0 0 4px !important;
    letter-spacing: -0.01em;
}

.sft-dropzone__hint {
    font-size: 13px !important;
    color: var(--sft-text-muted) !important;
    margin: 8px 0 0 !important;
}

/* ============== LINK BUTTONS (testo cliccabile) ============== */

.sft-app .sft-link-btn {
    background: none !important;
    border: none !important;
    color: var(--sft-accent) !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 6px 4px !important;
    text-decoration: none !important;
    font-family: inherit !important;
    display: inline-block !important;
    margin-top: 6px !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    transition: color 0.15s;
    border-radius: 6px !important;
}

.sft-app .sft-link-btn:hover {
    color: var(--sft-accent-hover) !important;
    background: var(--sft-accent-soft) !important;
}

/* ============== FILES LIST ============== */

.sft-files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    max-height: 240px;
    overflow-y: auto;
    padding: 2px;
}

.sft-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid var(--sft-border);
    transition: background 0.15s;
}

.sft-file-item:hover {
    background: #f4f4f5;
}

.sft-file-item__icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--sft-accent-soft);
    border-radius: 8px;
    color: var(--sft-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sft-file-item__icon svg {
    width: 18px;
    height: 18px;
}

.sft-file-item__info {
    flex: 1;
    min-width: 0;
}

.sft-file-item__name {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--sft-text) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 !important;
}

.sft-file-item__size {
    font-size: 12px !important;
    color: var(--sft-text-muted) !important;
    margin: 2px 0 0 !important;
}

.sft-file-item__remove {
    background: none !important;
    border: none !important;
    color: var(--sft-text-muted) !important;
    cursor: pointer !important;
    padding: 6px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s;
}

.sft-file-item__remove:hover {
    background: var(--sft-danger-soft) !important;
    color: var(--sft-danger) !important;
}

.sft-file-item__remove svg {
    width: 16px;
    height: 16px;
}

/* ============== ADD MORE BUTTON ============== */

.sft-app .sft-add-more {
    background: none !important;
    border: 1.5px dashed var(--sft-border-strong) !important;
    border-radius: 10px !important;
    padding: 12px !important;
    width: 100% !important;
    color: var(--sft-text-muted) !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.15s;
    margin-bottom: 20px !important;
    display: block !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

.sft-app .sft-add-more:hover {
    border-color: var(--sft-accent) !important;
    color: var(--sft-accent) !important;
    background: var(--sft-accent-soft) !important;
}

/* ============== FORM ============== */

.sft-app .sft-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    margin: 0 !important;
}

.sft-app .sft-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    margin: 0 !important;
}

.sft-app .sft-field__label {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--sft-text-secondary) !important;
    letter-spacing: 0.02em !important;
    display: block !important;
    margin: 0 !important;
    text-transform: none !important;
}

.sft-app .sft-field--turnstile {
    margin-top: 4px !important;
}

.sft-turnstile-wrap {
    min-height: 65px;
}

.sft-app .sft-field--turnstile .sft-field__label {
    margin-bottom: 8px !important;
}

.sft-app .sft-field input,
.sft-app .sft-field textarea,
.sft-app .sft-field select {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 1.5px solid var(--sft-border) !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: var(--sft-text) !important;
    background: var(--sft-surface) !important;
    box-shadow: none !important;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    display: block !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.4 !important;
    outline: none !important;
}

.sft-app .sft-field input::placeholder,
.sft-app .sft-field textarea::placeholder {
    color: var(--sft-text-tertiary) !important;
    opacity: 1;
}

.sft-app .sft-field input:hover,
.sft-app .sft-field textarea:hover,
.sft-app .sft-field select:hover {
    border-color: var(--sft-border-strong) !important;
}

.sft-app .sft-field input:focus,
.sft-app .sft-field textarea:focus,
.sft-app .sft-field select:focus {
    outline: none !important;
    border-color: var(--sft-accent) !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12) !important;
    background: var(--sft-surface) !important;
}

.sft-app .sft-field select {
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    padding-right: 40px !important;
}

/* ============== CONSENT ============== */

.sft-app .sft-consent {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px 14px !important;
    background: #fafafa !important;
    border: 1px solid var(--sft-border) !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    color: var(--sft-text-secondary) !important;
    line-height: 1.5 !important;
    cursor: pointer !important;
    margin: 0 !important;
}

.sft-app .sft-consent input[type="checkbox"] {
    margin: 2px 0 0 !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    accent-color: var(--sft-accent) !important;
    cursor: pointer !important;
}

.sft-app .sft-consent__text {
    flex: 1;
    display: block;
}

.sft-app .sft-consent__text a {
    color: var(--sft-accent) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    border-bottom: 1px solid currentColor !important;
}

.sft-app .sft-consent__text a:hover {
    color: var(--sft-accent-hover) !important;
}

/* ============== SUBMIT BUTTON ============== */

.sft-app .sft-submit {
    display: block !important;
    width: 100% !important;
    background: linear-gradient(180deg, #18181b, #09090b) !important;
    color: #fff !important;
    border: none !important;
    padding: 14px 20px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-top: 4px !important;
    transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
    font-family: inherit !important;
    text-align: center !important;
    line-height: 1.4 !important;
    letter-spacing: -0.01em !important;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.08),
        0 4px 12px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.1) !important;
    text-decoration: none !important;
    -webkit-appearance: none;
    position: relative;
    overflow: hidden;
}

.sft-app .sft-submit:hover {
    background: linear-gradient(180deg, #27272a, #18181b) !important;
    color: #fff !important;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.1),
        0 8px 20px rgba(0,0,0,0.18),
        inset 0 1px 0 rgba(255,255,255,0.15) !important;
}

.sft-app .sft-submit:active {
    transform: scale(0.98) !important;
}

.sft-app .sft-submit:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* ============== PROGRESS RING (upload in corso) ============== */

.sft-uploading {
    text-align: center;
    padding: 20px 0;
}

.sft-progress-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
}

.sft-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.sft-progress-ring__bg {
    fill: none;
    stroke: #f4f4f5;
    stroke-width: 6;
}

.sft-progress-ring__fg {
    fill: none;
    stroke: var(--sft-accent);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 276.46;
    stroke-dashoffset: 276.46;
    transition: stroke-dashoffset 0.3s ease;
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.4));
}

.sft-progress-ring__text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--sft-text) !important;
    letter-spacing: -0.02em;
}

.sft-uploading__title {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: var(--sft-text) !important;
    margin: 0 0 4px !important;
}

.sft-uploading__detail {
    font-size: 13px !important;
    color: var(--sft-text-muted) !important;
    margin: 0 !important;
}

/* ============== SUCCESS ============== */

.sft-success {
    text-align: center;
    padding: 12px 0;
}

.sft-success__check {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow:
        0 8px 24px rgba(16, 185, 129, 0.35),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.sft-success__check svg {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

.sft-success__title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--sft-text) !important;
    margin: 0 0 4px !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
}

.sft-success__subtitle {
    font-size: 13px !important;
    color: var(--sft-text-muted) !important;
    margin: 0 0 22px !important;
}

/* ============== LINK BOX ============== */

.sft-app .sft-link-box {
    display: flex !important;
    align-items: stretch !important;
    background: #fafafa !important;
    border: 1.5px solid var(--sft-border) !important;
    border-radius: 12px !important;
    padding: 4px !important;
    margin-bottom: 14px !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sft-app .sft-link-box:focus-within {
    border-color: var(--sft-accent) !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12) !important;
}

.sft-app .sft-link-box input {
    flex: 1 !important;
    border: none !important;
    background: transparent !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-family: 'SF Mono', Menlo, Consolas, monospace !important;
    color: var(--sft-text) !important;
    min-width: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    outline: none !important;
}

.sft-app .sft-link-box input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.sft-app .sft-copy-btn {
    background: var(--sft-text) !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    transition: all 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06) !important;
    display: block !important;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.sft-app .sft-copy-btn:hover {
    background: #27272a !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12) !important;
}

.sft-app .sft-copy-btn.is-copied {
    background: var(--sft-success) !important;
}

/* ============== STAGE FOOTER (privacy/terms link) ============== */

.sft-stage__footer {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.sft-stage__footer a {
    color: rgba(255, 255, 255, 0.95) !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding-bottom: 1px;
    transition: border-color 0.15s;
    font-weight: 400;
}

.sft-stage__footer a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.95);
}

.sft-stage__sep {
    margin: 0 10px;
    opacity: 0.6;
}

/* ============== AUTH MODAL ============== */

.sft-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.sft-auth-modal.sft-is-closed {
    display: none !important;
}

.sft-auth-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: sft-fade-in 0.2s ease;
}

.sft-auth-modal__panel {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 32px;
    box-shadow:
        0 32px 64px -16px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    animation: sft-modal-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: #09090b;
}

@keyframes sft-modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sft-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sft-auth-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #f4f4f5 !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    font-size: 18px !important;
    line-height: 1 !important;
    color: #52525b !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: all 0.15s;
}

.sft-auth-modal__close:hover {
    background: #e4e4e7 !important;
    color: #09090b !important;
    transform: scale(1.05);
}

/* ============== AUTH CARD (inline) ============== */

.sft-auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    max-width: 420px;
    margin: 40px auto;
    box-shadow: 0 12px 40px -10px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    color: #09090b !important;
}

.sft-auth-card h2 {
    font-size: 22px !important;
    font-weight: 700 !important;
    margin: 0 0 8px !important;
    letter-spacing: -0.02em !important;
    color: #09090b !important;
}

.sft-auth-card__link {
    color: #0ea5e9 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
}

/* ============== AUTH TABS ============== */

.sft-auth-tabs {
    display: flex;
    gap: 4px;
    background: #f4f4f5;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
}

.sft-auth-tab {
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    color: #71717a !important;
    transition: all 0.15s;
    text-align: center !important;
}

.sft-auth-tab.is-active {
    background: #fff !important;
    color: #09090b !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ============== AUTH FORM ============== */

.sft-auth-form {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.sft-auth-form.is-active {
    display: flex !important;
}

.sft-auth-form .sft-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
}

.sft-auth-form .sft-field__label {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #52525b !important;
    letter-spacing: 0.02em !important;
    display: block !important;
    margin: 0 !important;
}

.sft-auth-form .sft-field input {
    width: 100% !important;
    padding: 12px 14px !important;
    border: 1.5px solid #e4e4e7 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #09090b !important;
    background: #fff !important;
    box-shadow: none !important;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: block !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    -webkit-appearance: none;
    outline: none !important;
}

.sft-auth-form .sft-field input:hover {
    border-color: #d4d4d8 !important;
}

.sft-auth-form .sft-field input:focus {
    outline: none !important;
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12) !important;
}

.sft-auth-form .sft-submit {
    display: block !important;
    width: 100% !important;
    background: linear-gradient(180deg, #18181b, #09090b) !important;
    color: #fff !important;
    border: none !important;
    padding: 13px 20px !important;
    border-radius: 11px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-top: 4px !important;
    transition: all 0.15s;
    font-family: inherit !important;
    text-align: center !important;
    line-height: 1.4 !important;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.08),
        0 4px 12px rgba(0,0,0,0.12),
        inset 0 1px 0 rgba(255,255,255,0.1) !important;
    text-decoration: none !important;
    -webkit-appearance: none;
}

.sft-auth-form .sft-submit:hover {
    background: linear-gradient(180deg, #27272a, #18181b) !important;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.1),
        0 8px 20px rgba(0,0,0,0.18),
        inset 0 1px 0 rgba(255,255,255,0.15) !important;
}

.sft-auth-form .sft-submit:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.sft-auth-error {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 2px;
}

.sft-is-hidden { display: none !important; }

.sft-auth-switch {
    text-align: center !important;
    font-size: 13px !important;
    color: #71717a !important;
    margin: 8px 0 0 !important;
}

.sft-auth-switch a {
    color: #0ea5e9 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.sft-auth-switch a:hover {
    color: #0284c7 !important;
}

/* ============== USER WIDGET (avatar in alto a destra) ============== */

.sft-user-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99998;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.sft-user-widget__btn {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.95) !important;
    background: #fff !important;
    cursor: pointer !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.sft-user-widget__btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.22),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.sft-user-widget__avatar {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    display: block;
    object-fit: cover;
}

.sft-user-widget__initial {
    font-weight: 700;
    font-size: 16px;
    color: #0ea5e9;
}

.sft-user-widget__menu {
    position: absolute;
    top: 56px;
    right: 0;
    width: 260px;
    background: #fff;
    border-radius: 14px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: sft-modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.sft-user-widget__header {
    padding: 14px 16px;
    border-bottom: 1px solid #f4f4f5;
}

.sft-user-widget__name {
    margin: 0 0 2px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #09090b !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sft-user-widget__email {
    margin: 0 !important;
    font-size: 12px !important;
    color: #71717a !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sft-user-widget__link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 11px 16px !important;
    color: #09090b !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: background-color 0.12s;
}

.sft-user-widget__link:hover {
    background: #fafafa !important;
}

.sft-user-widget__link--danger {
    color: #b91c1c !important;
    border-top: 1px solid #f4f4f5;
}

.sft-user-widget__link--danger:hover {
    background: #fef2f2 !important;
}

.sft-user-widget__link svg {
    flex-shrink: 0;
    opacity: 0.7;
    width: 16px;
    height: 16px;
}

/* ============== DOWNLOAD PAGE ============== */

.sft-download-wrap {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.sft-download-card {
    background: #fff;
    border-radius: 20px;
    box-shadow:
        0 24px 48px -12px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 32px;
    max-width: 480px;
    width: 100%;
}

.sft-download-card__header {
    text-align: center;
    margin-bottom: 24px;
}

.sft-download-card__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: var(--sft-accent-soft);
    color: var(--sft-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sft-download-card__title {
    font-size: 22px !important;
    font-weight: 700 !important;
    margin: 0 0 6px !important;
    color: #09090b !important;
    letter-spacing: -0.02em;
}

.sft-download-card__meta {
    font-size: 13px;
    color: #71717a;
    margin: 0;
}

.sft-download-card__message {
    background: #fafafa;
    border-left: 3px solid #0ea5e9;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    color: #27272a;
}

.sft-download-card__files {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    border-top: 1px solid #e4e4e7;
    max-height: 240px;
    overflow-y: auto;
}

.sft-download-card__files li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f4f4f5;
    font-size: 14px;
}

.sft-download-card__files li:last-child {
    border-bottom: none;
}

.sft-download-card__file-name {
    color: #09090b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
}

.sft-download-card__file-size {
    color: #71717a;
    font-size: 12px;
    flex-shrink: 0;
}

.sft-download-btn {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #18181b, #09090b);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s;
    font-family: inherit;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.08),
        0 4px 12px rgba(0,0,0,0.12);
}

.sft-download-btn:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow:
        0 8px 20px rgba(0,0,0,0.18);
}

/* ============== USER DASHBOARD ============== */
/* (mantengo gli stili esistenti della dashboard utente, sono solo aggiunti dopo) */

.sft-dashboard {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    color: #09090b;
}

.sft-dashboard__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
}

.sft-dashboard__eyebrow {
    font-size: 12px;
    font-weight: 500;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 4px;
}

.sft-dashboard__title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.sft-dashboard__logout {
    color: #71717a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.sft-dashboard__logout:hover { color: #09090b; }

.sft-dashboard .sft-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.sft-dashboard .sft-kpi {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    padding: 16px;
}

.sft-kpi__label {
    font-size: 11px;
    font-weight: 500;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 4px;
}

.sft-kpi__value {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.sft-chart-card, .sft-transfers-card {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.sft-section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}

.sft-sparkline {
    width: 100%;
    height: 160px;
    display: block;
}

.sft-transfers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sft-transfer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: #fafafa;
    border-radius: 10px;
    gap: 12px;
}

.sft-transfer-item:hover { background: #f4f4f5; }
.sft-transfer-item__main { flex: 1; min-width: 0; }
.sft-transfer-item__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.sft-transfer-item__to { font-size: 14px; }
.sft-transfer-item__meta { display: flex; gap: 6px; font-size: 12px; color: #71717a; }
.sft-transfer-item__actions { display: flex; gap: 6px; flex-shrink: 0; }

.sft-action-btn {
    background: #09090b;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.sft-action-btn--ghost { background: transparent; color: #09090b; border: 1px solid #e4e4e7; }
.sft-action-btn--ghost:hover { background: #fff; border-color: #09090b; }
.sft-action-btn--danger { background: #fff; color: #b91c1c; border: 1px solid #fecaca; }
.sft-action-btn--danger:hover { background: #fee2e2; }

.sft-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.sft-status--active { background: var(--sft-success-soft, #d1fae5); color: #065f46; }
.sft-status--expired { background: #e4e4e7; color: #71717a; }

/* ============== RESPONSIVE ============== */

@media (max-width: 600px) {
    .sft-stage {
        padding: 20px 14px;
        min-height: auto;
    }
    .sft-hero__title { font-size: 30px; }
    .sft-hero__subtitle { font-size: 14px; }
    .sft-panel { padding: 20px; }
    .sft-app, .sft-stage__inner { max-width: 100%; }
    .sft-dashboard .sft-kpis { grid-template-columns: 1fr 1fr; }
    .sft-dashboard__header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .sft-transfer-item { flex-direction: column; align-items: flex-start; }
}

/* ============== FULLSCREEN BODY ============== */

body.sft-fullscreen-body, body.sft-fullscreen-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body.sft-fullscreen-body .sft-stage,
body.sft-fullscreen-page .sft-stage {
    min-height: 100vh;
}

/* ============== DASHBOARD — LOGO + FULLSCREEN ============== */

.sft-dashboard__brand {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.sft-dashboard__brand a {
    display: inline-block;
    line-height: 0;
}

.sft-dashboard__logo {
    max-height: 56px;
    max-width: 180px;
    display: block;
}

/* Dashboard in modalità fullscreen — più respiro, sfondo grigio chiaro */
body.sft-fullscreen-body .sft-dashboard,
body.sft-fullscreen-page .sft-dashboard {
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 20px 60px;
    background: transparent;
}

body.sft-fullscreen-body,
body.sft-fullscreen-page {
    background: #fafafa !important;
}

/* ============== DOWNLOAD CARD — varianti ============== */

.sft-download-card__from {
    font-size: 14px !important;
    color: #52525b !important;
    margin: 0 0 6px !important;
    text-align: center;
}

.sft-download-card__from strong {
    color: #09090b !important;
    font-weight: 600;
}

.sft-download-card__icon--warning {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

.sft-download-card--error .sft-download-card__title {
    margin-bottom: 8px !important;
}

.sft-download-card--error .sft-download-card__meta {
    margin: 0 !important;
    line-height: 1.5;
}

/* ============== LANGUAGE SWITCHER (alto a sinistra) ============== */

.sft-lang-switcher {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 99998;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.sft-lang-switcher__btn {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 44px !important;
    padding: 0 12px !important;
    border-radius: 22px !important;
    border: 2px solid rgba(255, 255, 255, 0.95) !important;
    background: #fff !important;
    cursor: pointer !important;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
    font-family: inherit !important;
    color: #09090b !important;
}

.sft-lang-switcher__btn:hover {
    transform: scale(1.04);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.22),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.sft-lang-switcher__flag {
    font-size: 18px;
    line-height: 1;
    /* Forza il rendering colore delle emoji su tutti i browser/OS */
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", sans-serif !important;
}

.sft-lang-switcher__code {
    font-size: 12px;
    font-weight: 700;
    color: #52525b;
    letter-spacing: 0.04em;
}

.sft-lang-switcher__menu {
    position: absolute;
    top: 56px;
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 14px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    padding: 6px;
    animation: sft-modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.sft-lang-switcher__item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 9px 12px !important;
    border-radius: 8px !important;
    color: #09090b !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: background-color 0.12s;
}

.sft-lang-switcher__item:hover {
    background: #fafafa !important;
}

.sft-lang-switcher__item.is-active {
    background: #eff6ff !important;
    color: #2563eb !important;
}

.sft-lang-switcher__item .sft-lang-switcher__flag {
    font-size: 16px;
}

/* ============== ADVANCED OPTIONS (collapsible) ============== */

.sft-app .sft-advanced-options {
    border: 1.5px solid var(--sft-border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.sft-app .sft-advanced-options[open] {
    border-color: var(--sft-border-strong);
}

.sft-app .sft-advanced-options summary {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sft-text-secondary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.sft-app .sft-advanced-options summary::-webkit-details-marker {
    display: none;
}

.sft-app .sft-advanced-options summary::before {
    content: '⚙';
    font-size: 14px;
}

.sft-app .sft-advanced-options summary::after {
    content: '';
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--sft-text-muted);
    transition: transform 0.2s;
}

.sft-app .sft-advanced-options[open] summary::after {
    transform: rotate(180deg);
}

.sft-app .sft-advanced-options summary:hover {
    background: #fafafa;
}

.sft-app .sft-advanced-options__body {
    padding: 0 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 1px solid var(--sft-border);
    padding-top: 14px;
}

.sft-app .sft-checkbox--inline {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 13px !important;
    color: var(--sft-text-secondary) !important;
    cursor: pointer !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
}

.sft-app .sft-checkbox--inline input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    accent-color: var(--sft-accent) !important;
    cursor: pointer !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

/* ============== SUCCESS BADGES ============== */

.sft-success__badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px !important;
    flex-wrap: wrap;
}

.sft-badge--lock,
.sft-badge--limit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.sft-badge--lock {
    background: var(--sft-warning-soft);
    color: #92400e;
}

.sft-badge--limit {
    background: var(--sft-accent-soft);
    color: #0369a1;
}

/* ============== QR CODE ============== */

.sft-qrcode {
    text-align: center;
    margin: 12px 0 4px;
}

.sft-qrcode__img {
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 4px solid #fff;
    background: #fff;
}

/* ============== PASSWORD GATE (download page) ============== */

.sft-download-card--password .sft-download-card__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: var(--sft-warning-soft, #fef3c7);
    color: var(--sft-warning, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sft-password-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.sft-password-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e4e4e7;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #09090b;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sft-password-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.sft-download-card__error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 12px;
    text-align: center;
}

/* ============== FILE PREVIEW (download page) ============== */

.sft-file-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f4f4f5;
}

.sft-file-preview-item:last-child {
    border-bottom: none;
}

.sft-file-preview-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sft-file-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sft-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sft-file-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sft-file-thumb--video {
    position: relative;
    cursor: default;
}

.sft-file-thumb__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    background: rgba(0,0,0,0.35);
    pointer-events: none;
}

.sft-file-thumb--icon {
    background: #eff6ff;
    color: #2563eb;
}

.sft-file-thumb--icon svg {
    width: 24px;
    height: 24px;
}

/* ============== DOWNLOAD LIMIT MESSAGE ============== */

.sft-download-card__limit-msg {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 16px;
    line-height: 1.5;
}

.sft-download-card__limit-msg svg {
    flex-shrink: 0;
}
