/* ============================================================
   xORG · Programa de Estágio — Landing gamificada
   Estética herdada do site institucional xORG.me
   ============================================================ */

:root {
    --bg: #050505;
    --bg-soft: #0c0c12;
    --text: #e6e6ec;
    --text-dim: #9aa0aa;
    --cyan: #00f3ff;
    --purple: #bc13fe;
    --green: #5cffb1;
    --red: #ff4e6a;
    --yellow: #ffd166;

    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-strong: rgba(255, 255, 255, 0.08);

    --font-h: 'Space Grotesk', sans-serif;
    --font-b: 'Inter', sans-serif;

    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-xl: 28px;

    --shadow-cyan: 0 0 30px rgba(0, 243, 255, 0.25);
    --shadow-purple: 0 0 30px rgba(188, 19, 254, 0.30);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-b);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(800px 500px at 15% 10%, rgba(0, 243, 255, 0.10), transparent 60%),
        radial-gradient(900px 600px at 85% 90%, rgba(188, 19, 254, 0.12), transparent 65%);
    pointer-events: none;
    z-index: -1;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.55;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-h);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

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

button {
    font-family: inherit;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

input,
select,
textarea {
    font-family: inherit;
    color: inherit;
}

/* ===================== HUD ===================== */

.hud {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(5, 5, 5, 0.7);
    border-bottom: 1px solid var(--glass-border);
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 28px;
    padding: 14px 32px;
}

.hud-logo img {
    height: 38px;
    filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.4));
}

.hud-center {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 760px;
}

.hud-stats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.stat-label {
    font-family: var(--font-h);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.stat-value {
    font-family: var(--font-h);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.xp-bar {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.xp-bar-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    border-radius: 99px;
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.5);
    transition: width 0.8s cubic-bezier(.6, .2, .2, 1);
}

.xp-bar-markers {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 25%;
    pointer-events: none;
}

.xp-bar-markers span {
    width: 1px;
    background: rgba(255, 255, 255, 0.18);
}

/* ===================== Screens ===================== */

main {
    min-height: calc(100vh - 60px);
    padding: 80px 24px 120px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.screen {
    width: 100%;
    max-width: 920px;
    display: none;
    animation: fadeIn 0.6s ease forwards;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

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

/* ===================== Intro ===================== */

.intro-wrap {
    text-align: center;
    padding: 24px 0 32px;
}

.intro-logo {
    width: 72px;
    margin: 0 auto 18px;
    display: block;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 0 24px rgba(0, 243, 255, 0.35));
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.tag {
    display: inline-block;
    font-family: var(--font-h);
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    border-radius: 99px;
    color: var(--cyan);
    margin-bottom: 24px;
}

.intro-wrap h1 {
    font-size: clamp(1.8rem, 4.4vw, 3rem);
    margin-bottom: 16px;
}

.grad {
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    font-size: 1rem;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 26px;
}

.lead strong {
    color: var(--text);
    font-weight: 600;
}

.rules {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 28px;
    max-width: 760px;
    list-style: none;
    padding: 0;
}

.rule {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    padding: 8px 16px 8px 10px;
    backdrop-filter: blur(8px);
    font-size: 0.85rem;
    color: var(--text-dim);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.rule:hover {
    border-color: rgba(0, 243, 255, 0.4);
    transform: translateY(-1px);
}

.rule-num {
    font-family: var(--font-h);
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    color: var(--cyan);
    background: rgba(0, 243, 255, 0.08);
    border: 1px solid rgba(0, 243, 255, 0.25);
    border-radius: 99px;
    padding: 2px 8px;
    flex-shrink: 0;
}

.rule strong {
    color: var(--text);
    font-weight: 600;
}

/* ===================== Buttons ===================== */

.cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    font-family: var(--font-h);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    color: #050505;
    border-radius: 99px;
    box-shadow: var(--shadow-cyan);
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-purple), var(--shadow-cyan);
}

.cta:active {
    transform: translateY(0);
}

.cta:disabled {
    filter: grayscale(0.6) brightness(0.7);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ghost {
    padding: 14px 22px;
    font-family: var(--font-h);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-dim);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    background: transparent;
    transition: all 0.2s ease;
}

.ghost:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.small-note {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: 16px;
}

/* End-state: frase nerd sorteada */
.end-quote {
    font-family: var(--font-h);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.05), rgba(188, 19, 254, 0.05));
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 22px 28px;
    margin: 36px auto 0;
    max-width: 520px;
    font-style: italic;
}

.end-quote-mark {
    font-size: 1.6rem;
    color: var(--cyan);
    font-style: normal;
    line-height: 1;
    vertical-align: -2px;
}

.end-quote-text {
    margin: 0 6px;
}

.end-quote-src {
    display: inline-block;
    margin-top: 10px;
    font-family: var(--font-b);
    font-size: 0.78rem;
    font-style: normal;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}

/* ===================== Quiz ===================== */

.quiz-wrap {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: 40px;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.quiz-header {
    text-align: center;
    margin-bottom: 32px;
}

.quiz-tag {
    display: inline-block;
    font-family: var(--font-h);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--purple);
    padding: 6px 14px;
    border: 1px solid rgba(188, 19, 254, 0.4);
    border-radius: 99px;
    margin-bottom: 16px;
}

.quiz-wrap h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    margin-bottom: 10px;
}

.quiz-sub {
    color: var(--text-dim);
    font-size: 0.98rem;
    max-width: 540px;
    margin: 0 auto;
}

.quiz-stage {
    margin: 0 auto 32px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-sequence {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.stage-sequence .seq-cell,
.stage-sequence .seq-q {
    width: 96px;
    height: 96px;
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-sequence .seq-q {
    border: 1px dashed var(--cyan);
    color: var(--cyan);
    font-family: var(--font-h);
    font-size: 2rem;
    font-weight: 700;
}

.stage-sequence .seq-sep {
    color: var(--text-dim);
    font-size: 1.4rem;
}

.stage-3d {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.stage-3d svg {
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

/* Containers das canvases 3D */
.three-host {
    width: 100%;
    height: 130px;
    border-radius: 10px;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 25%, rgba(0, 243, 255, 0.08), transparent 60%),
        radial-gradient(circle at 70% 75%, rgba(188, 19, 254, 0.08), transparent 60%),
        rgba(255, 255, 255, 0.02);
    display: block;
}

.three-host-ref {
    width: 100%;
    max-width: 360px;
    height: 280px;
    margin: 0 auto;
    cursor: grab;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
}

.three-host-ref:active {
    cursor: grabbing;
}

.three-host canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.stage-hint {
    font-size: 0.82rem;
    color: var(--text-dim);
    text-align: center;
    margin: 0;
    letter-spacing: 0.04em;
}

.stage-hint::before {
    content: '◐  ';
    color: var(--cyan);
    margin-right: 2px;
}

/* Opções com canvas 3D */
.opt.opt-3d {
    padding: 6px 8px;
    min-height: 150px;
}

.opt.opt-3d canvas {
    pointer-events: none;
    /* clique passa para o botão */
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.opt {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    position: relative;
}

.opt:hover {
    border-color: rgba(0, 243, 255, 0.55);
    transform: translateY(-2px);
    background: rgba(0, 243, 255, 0.04);
}

.opt.selected {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(0, 243, 255, 0.12), 0 0 20px rgba(0, 243, 255, 0.25);
    background: rgba(0, 243, 255, 0.06);
}

.opt.correct {
    border-color: var(--green) !important;
    box-shadow: 0 0 0 4px rgba(92, 255, 177, 0.14), 0 0 24px rgba(92, 255, 177, 0.35);
    background: rgba(92, 255, 177, 0.08);
}

.opt.wrong {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 4px rgba(255, 78, 106, 0.14);
    background: rgba(255, 78, 106, 0.08);
}

.opt.disabled {
    pointer-events: none;
    opacity: 0.55;
}

.opt svg {
    max-width: 80px;
    max-height: 80px;
}

.opt .opt-letter {
    position: absolute;
    top: 8px;
    left: 12px;
    font-family: var(--font-h);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--text-dim);
}

.quiz-feedback {
    min-height: 26px;
    margin-bottom: 16px;
    text-align: center;
    font-family: var(--font-h);
    font-weight: 500;
    font-size: 0.95rem;
}

.quiz-feedback.ok {
    color: var(--green);
}

.quiz-feedback.no {
    color: var(--red);
}

.quiz-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

/* XP floater */
.xp-pop {
    position: fixed;
    pointer-events: none;
    z-index: 200;
    font-family: var(--font-h);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--cyan);
    text-shadow: 0 0 12px rgba(0, 243, 255, 0.7);
    animation: pop 1.2s ease forwards;
}

@keyframes pop {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.8);
    }

    20% {
        opacity: 1;
        transform: translateY(-10px) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translateY(-70px) scale(1);
    }
}

/* ===================== Form ===================== */

.form-wrap {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    padding: 40px;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-header h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    margin: 12px 0 8px;
}

fieldset {
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 22px 24px 26px;
    margin-bottom: 22px;
    background: rgba(255, 255, 255, 0.02);
}

legend {
    font-family: var(--font-h);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cyan);
    padding: 0 10px;
}

/* Card "Sobre você" — destaque sutil para a seção de perguntas pessoais */
fieldset.personal-card {
    position: relative;
    background:
        linear-gradient(135deg, rgba(0, 243, 255, 0.025), rgba(188, 19, 254, 0.025)),
        rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(0, 243, 255, 0.18);
    box-shadow: 0 0 0 0 transparent;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

fieldset.personal-card:focus-within {
    border-color: rgba(0, 243, 255, 0.35);
    box-shadow: 0 0 0 4px rgba(0, 243, 255, 0.06);
}

fieldset.personal-card > legend {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-transform: none;
    letter-spacing: 0.06em;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(0, 243, 255, 0.10), rgba(188, 19, 254, 0.10));
    border: 1px solid rgba(0, 243, 255, 0.28);
    border-radius: 99px;
    padding: 5px 14px;
}

fieldset.personal-card > legend > span:first-child {
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

fieldset.personal-card .opt-tag {
    font-family: var(--font-h);
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 2px 9px;
    border-radius: 99px;
    background-clip: padding-box;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field.span-2 {
    grid-column: 1 / -1;
}

.field span {
    font-family: var(--font-h);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.field input,
.field select,
.field textarea {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    font-size: 0.96rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(0, 243, 255, 0.12);
    background: rgba(0, 243, 255, 0.03);
}

.field input::placeholder,
.field textarea::placeholder {
    color: rgba(154, 160, 170, 0.55);
}

.field input:invalid:not(:placeholder-shown) {
    border-color: rgba(255, 78, 106, 0.5);
}

.field textarea {
    resize: vertical;
    min-height: 90px;
}

.field select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%2300f3ff' stroke-width='1.5' stroke-linecap='round' d='M1 1l4 4 4-4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    color-scheme: dark;
}

/* Dropdown nativo: força tema escuro nas options (Chrome/Edge/Brave honram isto) */
.field select option {
    background-color: var(--bg-soft);
    color: var(--text);
}

.field select option:checked,
.field select option:hover {
    background-color: rgba(0, 243, 255, 0.15);
    color: var(--cyan);
}

.hint {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.terms {
    margin: 8px 4px 18px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text-dim);
}

.check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--cyan);
    flex-shrink: 0;
}

.form-actions {
    text-align: center;
}

.form-error {
    margin-top: 16px;
    color: var(--red);
    text-align: center;
    font-size: 0.92rem;
}

/* ===================== End screen ===================== */

.end-wrap {
    text-align: center;
    padding: 60px 0;
}

.end-badge {
    color: var(--green);
    margin-bottom: 24px;
    display: inline-flex;
    padding: 14px;
    border-radius: 50%;
    background: rgba(92, 255, 177, 0.08);
    border: 1px solid rgba(92, 255, 177, 0.3);
    animation: badgePop 0.8s cubic-bezier(.3, 1.6, .4, 1) forwards;
}

@keyframes badgePop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.end-wrap h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 16px;
}

.end-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 560px;
    margin: 40px auto 28px;
}

.end-stat {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 20px 14px;
}

.end-stat-label {
    display: block;
    font-family: var(--font-h);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.end-stat-value {
    display: block;
    font-family: var(--font-h);
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ===================== Footer ===================== */

.page-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 0.82rem;
    border-top: 1px solid var(--glass-border);
}

/* ===================== Responsivo ===================== */

@media (max-width: 720px) {
    main {
        padding: 40px 16px 80px;
    }

    .quiz-wrap,
    .form-wrap {
        padding: 24px 20px;
        border-radius: var(--r-lg);
    }

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

    .field.span-2 {
        grid-column: 1;
    }

    .hud {
        padding: 12px 16px;
        gap: 14px;
    }

    .hud-logo img {
        height: 30px;
    }

    .hud-stats {
        gap: 16px;
    }

    .stat-value {
        font-size: 0.92rem;
    }

    .stage-sequence .seq-cell,
    .stage-sequence .seq-q {
        width: 70px;
        height: 70px;
    }

    .stage-sequence .seq-cell svg,
    .stage-sequence .seq-q svg {
        width: 50px;
        height: 50px;
    }

    .end-stats {
        grid-template-columns: 1fr;
    }
}
