/* ============================================================
   StorageHub - Tema visual (complementa o Bootstrap 5)
   Paleta: base escura + indigo/violeta como primaria
   ============================================================ */

:root {
    --sh-primary: #6366f1;
    --sh-primary-dark: #4f46e5;
    --sh-accent: #22d3ee;
    --sh-sidebar-w: 260px;
}

[data-bs-theme="dark"] {
    --bs-primary: var(--sh-primary);
    --bs-primary-rgb: 99, 102, 241;
    --bs-body-bg: #0b0f1a;
    --bs-body-bg-rgb: 11, 15, 26;
    --bs-tertiary-bg: #10151f;
    --bs-border-color: #232a3b;
}

body {
    min-height: 100vh;
}

/* Botao primario com a cor da marca */
.btn-primary {
    --bs-btn-bg: var(--sh-primary);
    --bs-btn-border-color: var(--sh-primary);
    --bs-btn-hover-bg: var(--sh-primary-dark);
    --bs-btn-hover-border-color: var(--sh-primary-dark);
    --bs-btn-active-bg: var(--sh-primary-dark);
}

.text-primary { color: var(--sh-primary) !important; }
.link-primary { color: var(--sh-primary) !important; }

/* Marca */
.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--sh-primary), var(--sh-accent));
    color: #0b0f1a;
    font-weight: 800;
    letter-spacing: -.5px;
    font-size: 1.1rem;
}
.brand-badge.sm { width: 36px; height: 36px; border-radius: 10px; font-size: .9rem; }

/* ---------- Layout com sidebar ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--sh-sidebar-w);
    flex-shrink: 0;
    background: var(--bs-tertiary-bg);
    border-right: 1px solid var(--bs-border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    transform: translateX(0);
    transition: transform .25s ease;
}

.app-sidebar .nav-link {
    color: var(--bs-secondary-color);
    border-radius: 10px;
    padding: .6rem .85rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    font-weight: 500;
}
.app-sidebar .nav-link:hover { background: rgba(255, 255, 255, .04); color: var(--bs-body-color); }
.app-sidebar .nav-link.active {
    background: rgba(99, 102, 241, .15);
    color: #c7d2fe;
}
.app-sidebar .nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }

.app-main {
    flex: 1;
    margin-left: var(--sh-sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    height: 62px;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    background: rgba(11, 15, 26, .7);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-content { padding: 1.5rem; flex: 1; }

/* Backdrop mobile */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1035;
    display: none;
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-backdrop.show { display: block; }
}

/* ---------- Cards de metrica ---------- */
.stat-card { border: 1px solid var(--bs-border-color); border-radius: 16px; }
.stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(99, 102, 241, .15); color: #c7d2fe;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }

/* Barra de uso */
.usage-bar { height: 8px; border-radius: 99px; background: var(--bs-border-color); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--sh-primary), var(--sh-accent)); }
.usage-bar.warn > span { background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* Tabelas */
.table-card { border: 1px solid var(--bs-border-color); border-radius: 16px; overflow: hidden; }
.table-card .table { margin-bottom: 0; }

/* Dropzone de upload */
.dropzone {
    border: 2px dashed var(--bs-border-color);
    border-radius: 16px;
    padding: 2.5rem 1rem;
    text-align: center;
    transition: border-color .2s, background .2s;
    cursor: pointer;
}
.dropzone.dragover { border-color: var(--sh-primary); background: rgba(99, 102, 241, .08); }

/* Provedor badge */
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #1f1f1f;
    border: 1px solid #dadce0;
    font-weight: 500;
}
.btn-google:hover:not(:disabled) {
    background: #f7f8f8;
    color: #1f1f1f;
    border-color: #d2d3d5;
}
.btn-google:disabled {
    opacity: .55;
}

.provider-chip { font-size: .72rem; padding: .2rem .5rem; border-radius: 6px; font-weight: 600; }
.provider-chip.local        { background: #1f2937; color: #cbd5e1; }
.provider-chip.google_drive { background: #14351f; color: #86efac; }
.provider-chip.dropbox      { background: #12243f; color: #93c5fd; }
.provider-chip.onedrive     { background: #0e2a3a; color: #7dd3fc; }
.provider-chip.mega         { background: #3a1414; color: #fca5a5; }

/* ============================================================
   Telas de autenticacao / instalacao (cliente final)
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px circle at 15% 15%, rgba(99, 102, 241, .18), transparent 45%),
        radial-gradient(700px circle at 85% 85%, rgba(34, 211, 238, .12), transparent 45%),
        var(--bs-body-bg);
}

/* Brilho decorativo sutil no fundo */
.auth-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .015) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
    pointer-events: none;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}
.auth-shell.wide { max-width: 560px; }

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-brand h1 { font-weight: 700; letter-spacing: -.5px; margin: .85rem 0 .15rem; }
.auth-brand p { color: var(--bs-secondary-color); margin: 0; }

.brand-badge.lg { width: 60px; height: 60px; border-radius: 18px; font-size: 1.4rem; box-shadow: 0 12px 30px -8px rgba(99, 102, 241, .6); }

.auth-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01));
    border: 1px solid var(--bs-border-color);
    border-radius: 20px;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .7);
    backdrop-filter: blur(10px);
}
.auth-card .card-body { padding: 2rem; }

.auth-card .form-label { font-weight: 500; font-size: .9rem; }
.auth-card .form-control {
    background: rgba(255, 255, 255, .03);
    border-color: var(--bs-border-color);
    padding: .7rem .9rem;
    border-radius: 12px;
}
.auth-card .form-control:focus {
    background: rgba(255, 255, 255, .05);
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 .2rem rgba(99, 102, 241, .2);
}
.auth-card .btn-primary {
    padding: .7rem 1rem;
    border-radius: 12px;
    font-weight: 600;
}

.auth-foot { text-align: center; color: var(--bs-secondary-color); font-size: .85rem; margin-top: 1.25rem; }

/* Stepper do instalador */
.steps { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.75rem; }
.steps .step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; position: relative; }
.steps .step .dot {
    width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
    background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
}
.steps .step .label { font-size: .72rem; color: var(--bs-secondary-color); text-align: center; }
.steps .step.active .dot { background: var(--sh-primary); border-color: var(--sh-primary); color: #0b0f1a; }
.steps .step.active .label { color: var(--bs-body-color); font-weight: 600; }
.steps .step.done .dot { background: rgba(34, 211, 238, .18); border-color: var(--sh-accent); color: var(--sh-accent); }
.steps .step:not(:last-child)::after {
    content: ""; position: absolute; top: 17px; left: calc(50% + 22px); right: calc(-50% + 22px);
    height: 2px; background: var(--bs-border-color);
}
.steps .step.done:not(:last-child)::after { background: var(--sh-accent); }

.pw-hint { font-size: .8rem; }
