/* ====================================
   SETUP PAGE - VIBRANT REDESIGN V2
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #de406b;
    --primary-dark: #750423;
    --primary-light: #ff5a7f;
    --accent-purple: #6d28d9;
    --accent-purple-dark: #5b21b6;

    /* Brighter backgrounds */
    --bg-dark: #0f0715;
    --bg-secondary: #1a1220;
    --bg-tertiary: #2d2235;

    /* Better text contrast */
    --text-primary: #ffffff;
    --text-secondary: #e0d5ff;
    --text-muted: #b8a9d1;

    /* Card backgrounds - brighter */
    --card-bg-light: rgba(255, 255, 255, 0.05);
    --card-bg-accent: rgba(222, 64, 107, 0.12);

    --border-color: rgba(222, 64, 107, 0.35);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

html, body {
    overflow-x: hidden;
}

#setupSettings {
    width: 100%;
    min-height: 100vh;
    height: auto;
    background: linear-gradient(135deg, #0f0715 0%, #1a1220 40%, #2d2235 100%);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    font-family: 'Righteous', 'Segoe UI', sans-serif;
    animation: fadeIn 0.6s ease-out;
    user-select: none;
    position: relative;
    overflow: hidden;
}

/* Animated gradient background effect */
#setupSettings::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(222, 64, 107, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(109, 40, 217, 0.1) 0%, transparent 50%);
    animation: gradientShift 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-50px, -50px);
    }
}

#setupSettings > * {
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================================
   HEADER SECTION
   ==================================== */

.setup__header {
    width: 100%;
    max-width: 1300px;
    margin-bottom: 3rem;
    animation: slideDown 0.7s ease-out 0.1s both;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setup__logo {
    margin-bottom: 0;
}

.setup__logo img {
    height: 70px;
    filter: drop-shadow(0 8px 24px rgba(222, 64, 107, 0.25));
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.setup__logo img:hover {
    transform: scale(1.1) translateY(-3px);
    filter: drop-shadow(0 12px 32px rgba(222, 64, 107, 0.35));
}

.setup__header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
}

.setup__header-text {
    text-align: left;
    flex: 1;
}

.setup__title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 0%, #e0d5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.setup__subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0.3px;
}

.launch__button--header {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Righteous', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 8px 24px rgba(222, 64, 107, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    animation: slideDown 0.7s ease-out 0.2s both;
}

.launch__button--header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.launch__button--header:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(222, 64, 107, 0.4);
}

.launch__button--header:hover::before {
    left: 100%;
}

.launch__button--header:active {
    transform: translateY(-1px);
}

.launch__text {
    font-weight: 700;
}

.launch__arrow {
    font-size: 1.2rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.launch__button--header:hover .launch__arrow {
    transform: translateX(4px);
}

.setup__content {
    width: 100%;
    max-width: 1300px;
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
    animation: slideUp 0.7s ease-out 0.2s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .setup__content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.settings__panel,
.packs__panel {
    background: linear-gradient(135deg, var(--card-bg-light) 0%, var(--card-bg-accent) 100%);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.settings__panel::before,
.packs__panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.settings__panel:hover,
.packs__panel:hover {
    border-color: rgba(222, 64, 107, 0.6);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(222, 64, 107, 0.15) 100%);
    box-shadow: 0 12px 48px rgba(222, 64, 107, 0.15);
    transform: translateY(-4px);
}

.panel__title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 1.75rem 0;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid rgba(222, 64, 107, 0.4);
    position: relative;
    z-index: 1;
}

.panel__title::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    animation: expandWidth 0.8s ease-out 0.3s forwards;
}

@keyframes expandWidth {
    to {
        width: 60px;
    }
}

.setting__group {
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.setting__group:last-child {
    margin-bottom: 0;
}

.setting__label {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
    cursor: pointer;
}

.setting__label span:first-child {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: 0.2px;
}

.setting__description {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0.2px;
}

.length__options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.length__radio {
    display: none;
}

.length__label {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px solid rgba(222, 64, 107, 0.25);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    gap: 0.6rem;
    font-weight: 600;
    color: white;
}

.length__label::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.length__radio:checked + .length__label {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-light);
    color: white;
    box-shadow: 0 8px 32px rgba(222, 64, 107, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.length__radio:checked + .length__label::before {
    opacity: 1;
}

.length__badge {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.length__radio:checked + .length__label .length__badge {
    transform: scale(1.2);
}

.length__label span:nth-child(2) {
    font-size: 1rem;
    font-weight: 700;
    color: inherit;
}

.length__count {
    font-size: 0.85rem;
    opacity: 0.85;
    font-family: 'Segoe UI', monospace;
    font-weight: 600;
    color: var(--text-muted);
}

.length__radio:checked + .length__label .length__count {
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 600px) {
    .length__options {
        grid-template-columns: 1fr;
    }
}

/* ====================================
   TOGGLE SWITCH
   ==================================== */

.toggle__container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.toggle__input {
    display: none;
}

.toggle__switch {
    position: relative;
    width: 70px;
    height: 38px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px solid rgba(222, 64, 107, 0.25);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block;
    overflow: hidden;
}

.toggle__input:checked + .toggle__switch {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary-light);
    box-shadow: 0 6px 24px rgba(222, 64, 107, 0.3);
}

.toggle__inner {
    position: absolute;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.toggle__input:checked + .toggle__switch .toggle__inner {
    left: 35px;
}

.toggle__label {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.3s ease;
    letter-spacing: 0.2px;
}

.toggle__input:checked ~ .toggle__label {
    color: var(--success);
    font-weight: 700;
}

/* ====================================
   QUESTION PACKS GRID
   ==================================== */

.packs__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.75rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 600px) {
    .packs__grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1.25rem;
    }
}

.pack__card {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 2px solid rgba(222, 64, 107, 0.25);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    gap: 0.9rem;
    overflow: hidden;
}

.pack__card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(222, 64, 107, 0.1) 0%, rgba(109, 40, 217, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.pack__card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.pack__card:hover {
    border-color: var(--primary);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(222, 64, 107, 0.25);
}

.pack__card:hover::before {
    opacity: 1;
}

.pack__card > * {
    position: relative;
    z-index: 2;
}

.pack__header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.pack__icon {
    font-size: 2.2rem;
    display: block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pack__card:hover .pack__icon {
    transform: scale(1.2) rotate(5deg);
}

.pack__status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #06b6d4);
    display: none;
    box-shadow: 0 0 12px var(--success);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pack__checkbox:checked ~ .pack__status {
    display: block;
}

.pack__name {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.pack__description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 500;
    letter-spacing: 0.1px;
}

.pack__toggle {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.pack__checkbox {
    display: none;
}

.pack__toggle-label {
    position: relative;
    width: 54px;
    height: 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px solid rgba(222, 64, 107, 0.25);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block;
}

.pack__checkbox:checked + .pack__toggle-label {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(222, 64, 107, 0.3);
}

.pack__checkbox + .pack__toggle-label::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.pack__checkbox:checked + .pack__toggle-label::after {
    left: 28px;
}

/* ====================================
   PACKS EMPTY STATE & AUTH PROMPT
   ==================================== */

.packs__empty {
    grid-column: 1 / -1;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-family: 'Segoe UI', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
}

.auth__prompt {
    grid-column: 1 / -1;
    padding: 3.5rem 3rem;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.12) 0%, rgba(222, 64, 107, 0.12) 100%);
    border: 2px dashed rgba(222, 64, 107, 0.35);
    border-radius: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.auth__icon {
    font-size: 3.5rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.auth__prompt h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.auth__prompt p {
    color: var(--text-secondary);
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.auth__button {
    margin-top: 0.5rem;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Righteous', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 6px 20px rgba(222, 64, 107, 0.3);
    letter-spacing: 0.3px;
}

.auth__button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(222, 64, 107, 0.4);
}

.auth__button:active {
    transform: translateY(-1px);
}

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

@media (max-width: 768px) {
    #setupSettings {
        padding: 2rem 1.5rem;
    }

    .setup__header {
        margin-bottom: 2.5rem;
    }

    .setup__header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .setup__header-text {
        text-align: center;
    }

    .launch__button--header {
        width: 100%;
        justify-content: center;
        padding: 0.9rem 2rem;
    }

    .setup__title {
        font-size: 2.2rem;
    }

    .setup__subtitle {
        font-size: 1rem;
    }

    .setup__logo img {
        height: 60px;
    }

    .setup__content {
        gap: 2rem;
    }

    .settings__panel,
    .packs__panel {
        padding: 2rem;
    }

    .panel__title {
        font-size: 1.2rem;
    }

    .packs__grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 480px) {
    #setupSettings {
        padding: 1.5rem 1rem;
    }

    .setup__header {
        margin-bottom: 2rem;
    }

    .setup__logo img {
        height: 55px;
    }

    .setup__title {
        font-size: 1.75rem;
    }

    .setup__subtitle {
        font-size: 0.95rem;
    }

    .launch__button--header {
        width: 100%;
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .launch__text {
        font-size: 0.95rem;
    }

    .launch__arrow {
        font-size: 1rem;
    }

    .settings__panel,
    .packs__panel {
        padding: 1.5rem;
    }

    .panel__title {
        font-size: 1.1rem;
    }

    .packs__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .pack__card {
        padding: 1.2rem 1rem;
    }

    .pack__name {
        font-size: 0.9rem;
    }

    .pack__icon {
        font-size: 2rem;
    }

    .length__options {
        gap: 0.75rem;
    }

    .length__label {
        padding: 1.25rem 1rem;
    }
}
