@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #05080d;
    --panel: rgba(15, 20, 29, 0.82);
    --panel-strong: rgba(18, 24, 34, 0.95);
    --line: rgba(255, 255, 255, 0.08);
    --line-green: rgba(45, 211, 111, 0.45);
    --text: #ffffff;
    --muted: #a8b0be;
    --green: #36d66b;
    --green-dark: #0f3d25;
    --purple: #8b5cf6;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    background:
            radial-gradient(circle at 24% 10%, rgba(45, 211, 111, 0.08), transparent 32%),
            radial-gradient(circle at 90% 0%, rgba(32, 115, 255, 0.06), transparent 35%),
            var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 14px;
    background: linear-gradient(180deg, rgba(13, 18, 27, 0.96), rgba(10, 14, 21, 0.98));
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 60px rgba(0, 0, 0, 0.25);
}

.brand {
    display: block;
    margin: 0 8px 48px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand span {
    color: var(--green);
}

.menu {
    display: grid;
    gap: 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 600;
    border: 1px solid transparent;
}

.menu-item:hover,
.menu-item.active {
    color: var(--green);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.04);
}

.menu-icon {
    font-size: 20px;
}

.sidebar-status {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 180px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(45, 211, 111, 0.18);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(28, 127, 61, 0.35), rgba(16, 24, 35, 0.82));
}

.spotify-badge {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: #062111;
    font-size: 22px;
}

.sidebar-status strong,
.sidebar-user strong {
    display: block;
    font-size: 14px;
}

.sidebar-status small,
.sidebar-user small {
    color: var(--muted);
}

.dot {
    margin-left: auto;
    width: 10px;
    height: 10px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--green);
}

.dot.off {
    background: #777;
    box-shadow: none;
}

.sidebar-user {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 26px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    cursor: default;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info strong,
.user-info small {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-menu-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: 0.18s ease;
}

.user-menu-button:hover,
.sidebar-user.open .user-menu-button {
    color: var(--green);
    border-color: rgba(45,211,111,0.35);
    background: rgba(45,211,111,0.12);
}

.user-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 72px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(12, 17, 25, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 24px 60px rgba(0,0,0,0.58);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.sidebar-user.open .user-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.user-dropdown::after {
    content: "";
    position: absolute;
    right: 22px;
    bottom: -7px;
    width: 14px;
    height: 14px;
    background: rgba(12, 17, 25, 0.98);
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transform: rotate(45deg);
}

.user-dropdown a {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 11px 13px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: 0.16s ease;
}

.user-dropdown a:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.user-dropdown .logout {
    color: #ff5f66;
}

.user-dropdown .logout:hover {
    background: rgba(255,95,102,0.12);
    color: #ff777d;
}

.avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #111722;
    border: 2px solid rgba(45, 211, 111, 0.55);
    overflow: hidden;
}

.avatar.large {
    width: 72px;
    height: 72px;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content {
    width: min(820px, calc(100vw - 260px));
    margin-left: 70px;
    padding: 52px 0 36px;
}

.hero h1 {
    margin: 0;
    font-size: 42px;
    letter-spacing: -1.6px;
}

.hero p {
    margin: 14px 0 58px;
    color: var(--muted);
    font-size: 17px;
}

.section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.section-header h2 {
    margin: 0;
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 27px;
}

.ghost-button {
    padding: 14px 22px;
    color: var(--green);
    font-weight: 700;
    border: 1px solid rgba(45, 211, 111, 0.28);
    border-radius: 13px;
    background: rgba(45, 211, 111, 0.08);
}

.module-card {
    display: grid;
    grid-template-columns: 300px 1fr auto;
    align-items: center;
    gap: 30px;
    min-height: 148px;
    margin-bottom: 16px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(18, 24, 34, 0.9), rgba(10, 15, 22, 0.85));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.module-card:hover {
    transform: translateY(-3px);
    border-color: rgba(45, 211, 111, 0.28);
    background: linear-gradient(135deg, rgba(22, 31, 43, 0.96), rgba(10, 15, 22, 0.9));
}

.module-text h3 {
    margin: 0 0 10px;
    font-size: 19px;
}

.module-text p {
    margin: 0 0 18px;
    line-height: 1.55;
    color: var(--muted);
}

.arrow {
    font-size: 42px;
    color: rgba(255, 255, 255, 0.42);
}

.spotify-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 13px;
    background: #030405;
    border: 1px solid rgba(255,255,255,0.08);
}

.cover-art {
    width: 76px;
    height: 76px;
    border-radius: 9px;
    background:
            linear-gradient(135deg, rgba(45, 211, 111, .35), transparent),
            linear-gradient(45deg, #20324d, #08080a);
}

.preview-content {
    flex: 1;
    min-width: 0;
}

.preview-content small,
.preview-content span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.preview-content strong {
    display: block;
    margin: 6px 0 2px;
    font-size: 17px;
}

.fake-progress {
    height: 6px;
    margin-top: 18px;
    border-radius: 99px;
    background: rgba(255,255,255,.16);
}

.fake-progress i {
    display: block;
    width: 62%;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.fake-time {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
}

.pill {
    display: inline-flex;
    padding: 8px 13px;
    color: var(--green);
    font-weight: 800;
    font-size: 13px;
    border-radius: 99px;
    background: rgba(45, 211, 111, 0.1);
}

.pill.off {
    color: #ffcc66;
    background: rgba(255, 204, 102, 0.12);
}

.pill.purple {
    color: #c5a7ff;
    background: rgba(139, 92, 246, 0.16);
}

.disabled-card {
    grid-template-columns: 96px 1fr auto;
}

.big-icon {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 44px;
    font-weight: 800;
}

.big-icon.green {
    color: var(--green);
    background: linear-gradient(135deg, rgba(45, 211, 111, 0.38), rgba(45, 211, 111, 0.1));
}

.purple-icon {
    color: #d7c4ff;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.75), rgba(139, 92, 246, 0.25));
    font-size: 30px;
}

.privacy-card {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 28px;
    margin-top: 62px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(18, 24, 34, 0.9), rgba(10, 15, 22, 0.86));
}

.privacy-card h3 {
    margin: 0 0 6px;
}

.privacy-card p {
    margin: 0;
    color: var(--muted);
}

.privacy-card a {
    color: var(--green);
    font-weight: 800;
}

.shield {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(45, 211, 111, 0.12);
    font-size: 25px;
}

footer {
    margin-top: 38px;
    color: rgba(255,255,255,.42);
}

.spotify-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 34px;
}

.spotify-panel {
    width: min(760px, 100%);
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
            radial-gradient(circle at 50% 8%, rgba(45, 211, 111, 0.08), transparent 32%),
            rgba(8, 12, 18, 0.94);
    box-shadow: var(--shadow);
}

.back-link {
    display: inline-flex;
    color: var(--green);
    font-weight: 700;
    margin-bottom: 30px;
}

.view.hidden {
    display: none;
}

.success-hero {
    padding: 24px 24px;
    text-align: center;
    border: 1px solid var(--line-green);
    border-radius: 14px;
    background:
            radial-gradient(circle at 50% 0%, rgba(45, 211, 111, 0.34), transparent 42%),
            linear-gradient(135deg, rgba(45, 211, 111, 0.16), rgba(7, 11, 16, 0.48));
}

.success-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border-radius: 50%;
    color: #03150a;
    font-size: 42px;
    font-weight: 900;
    background: var(--green);
    box-shadow: 0 20px 50px rgba(45, 211, 111, 0.24);
}

.spotify-logo {
    font-size: 46px;
}

.success-hero h1 {
    margin: 0 0 12px;
    font-size: 31px;
    letter-spacing: -1px;
}

.success-hero p {
    margin: 0;
    color: #d5dae2;
}

.info-card,
.return-card {
    display: block;
    margin-top: 22px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(18, 24, 34, 0.92), rgba(12, 17, 25, 0.92));
}

.info-card h2 {
    margin: 0 0 24px;
    font-size: 20px;
}

.info-card p {
    color: var(--muted);
    line-height: 1.6;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.account-row small {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.account-row strong {
    font-size: 20px;
}

.url-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    margin-top: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(45, 211, 111, 0.12), rgba(255,255,255,0.03));
}

.url-box code {
    color: var(--green);
    word-break: break-all;
    line-height: 1.6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.url-box button,
.connect-button {
    border: 0;
    cursor: pointer;
    padding: 16px 24px;
    border-radius: 10px;
    color: #dfffe9;
    font-weight: 900;
    font-size: 16px;
    background: linear-gradient(135deg, rgba(45, 211, 111, 0.62), rgba(45, 211, 111, 0.24));
    border: 1px solid rgba(45, 211, 111, 0.34);
}
.disconnect-button {
    border: 0;
    cursor: pointer;
    padding: 16px 24px;
    border-radius: 10px;
    color: #dfffe9;
    font-weight: 900;
    font-size: 16px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.62), rgba(255, 107, 107, 0.24));
    border: 1px solid rgba(255, 107, 107, 0.34);
}

.connect-button .disconnect-button{
    display: inline-flex;
    margin-top: 16px;
}

.security-box {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 28px;
    padding: 22px;
    color: #dfffe9;
    border-radius: 10px;
    border: 1px solid rgba(45, 211, 111, 0.38);
    background: rgba(45, 211, 111, 0.13);
}

.security-box span {
    font-size: 30px;
}

.security-box p {
    margin: 5px 0 0;
}

.return-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.return-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.home-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    font-size: 28px;
}

.steps {
    display: grid;
    gap: 14px;
}

.steps div {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
}

.steps span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #06150b;
    background: var(--green);
    font-weight: 900;
}

.error-card {
    border-color: rgba(255, 107, 107, 0.45);
}

/* =========================
   AMELIORATIONS BOUTONS
========================= */

.sidebar-status:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 211, 111, 0.35);
}

.ghost-button:hover {
    background: rgba(45, 211, 111, 0.14);
    border-color: rgba(45, 211, 111, 0.45);
}

.url-box button:hover,
.connect-button:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 211, 111, 0.55);
    background: linear-gradient(135deg, rgba(45, 211, 111, 0.72), rgba(45, 211, 111, 0.3));
}

.return-card:hover {
    transform: translateY(-2px);
    border-color: rgba(45, 211, 111, 0.22);
}

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

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        min-height: auto;
    }

    .sidebar-status,
    .sidebar-user {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        margin-top: 20px;
    }

    .sidebar-user {
        padding-bottom: 6px;
    }

    .user-dropdown {
        bottom: 66px;
    }

    .content {
        width: auto;
        margin: 0;
        padding: 30px 18px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .module-card,
    .disabled-card {
        grid-template-columns: 1fr;
    }

    .spotify-preview {
        width: 100%;
    }

    .privacy-card {
        grid-template-columns: 1fr;
    }

    .url-box {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .spotify-page {
        padding: 14px;
    }

    .spotify-panel {
        padding: 14px;
    }

    .success-hero {
        padding: 28px 16px;
    }

    .info-card,
    .return-card {
        padding: 18px;
    }

    .module-card {
        padding: 20px;
    }

    .spotify-preview {
        flex-direction: column;
        align-items: flex-start;
    }
}
