/* Coop BrandOS - identidade COOP
   Roxo #403ADD | Tinta #1D1D1B | Papel #ECECEC (extraidos dos assets oficiais) */

:root {
    --purple: #403ADD;
    --purple-dark: #322DB0;
    --purple-soft: #EEEDFC;
    --ink: #1D1D1B;
    --paper: #ECECEC;
    --white: #FFF;
    --gray-50: #F7F7F6;
    --gray-100: #EDEDEB;
    --gray-300: #D3D1C7;
    --gray-500: #6E6E68;
    --gray-700: #44443F;
    --green: #2E7D32;
    --amber: #B4690E;
    --red: #C0392B;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(29, 29, 27, .06), 0 4px 12px rgba(29, 29, 27, .04);
}

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }

/* ---------- estrutura ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--ink);
    color: var(--paper);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar__brand { display: flex; align-items: baseline; gap: 8px; padding: 0 8px 22px; }
.sidebar__brand .coop-logo { filter: invert(1) brightness(2); }
.sidebar__sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #8A8A85; }

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar__nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 8px;
    color: #C9C9C4; font-size: 14px;
    transition: background .15s, color .15s;
}
.sidebar__nav a:hover { background: rgba(255, 255, 255, .07); color: var(--white); }
.sidebar__nav a.is-active { background: var(--purple); color: var(--white); }
.sidebar__nav i { font-size: 18px; }

.sidebar__foot {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding-top: 12px; display: flex; align-items: center;
    justify-content: space-between; gap: 8px; font-size: 12px; color: #8A8A85;
}

.main { flex: 1; padding: 28px 32px 64px; max-width: 1180px; }

/* ---------- componentes ---------- */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head__crumb { font-size: 12px; color: var(--gray-500); margin-bottom: 2px; }
.page-head__crumb a:hover { color: var(--purple); }

.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 8px; border: 1px solid var(--gray-300);
    background: var(--white); color: var(--ink);
    font-size: 14px; font-weight: 500; font-family: inherit;
    cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--gray-100); border-color: var(--gray-500); }
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--purple); border-color: var(--purple); color: var(--white); }
.btn--primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); }
.btn--ghost { background: transparent; border-color: transparent; color: inherit; }
.btn--ghost:hover { background: rgba(255, 255, 255, .1); border-color: transparent; }
.btn--danger { color: var(--gray-500); }
.btn--danger:hover { background: #FDECEA; border-color: #F5C6C0; color: var(--red); }
.btn--sm { padding: 5px 9px; font-size: 12.5px; }
.btn i { font-size: 16px; }

.card {
    background: var(--white); border: 1px solid var(--gray-100);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}

.grid { display: grid; gap: 14px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.stat { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 16px 18px; }
.stat__label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .07em; }
.stat__value { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }

.flash { padding: 11px 15px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.flash--success { background: #EDF7EE; border-color: #C8E6C9; color: #1B5E20; }
.flash--error { background: #FDECEA; border-color: #F5C6C0; color: #922B21; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--gray-700); }
.field input, .field textarea, .field select {
    width: 100%; padding: 9px 11px; font-size: 14px; font-family: inherit;
    border: 1px solid var(--gray-300); border-radius: 8px; background: var(--white); color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft);
}
.field textarea { min-height: 88px; resize: vertical; }

.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
    border-radius: 999px; font-size: 11.5px; font-weight: 500;
    background: var(--gray-100); color: var(--gray-700);
}
.badge--draft { background: var(--gray-100); color: var(--gray-700); }
.badge--in_progress { background: #FFF3E0; color: var(--amber); }
.badge--completed { background: #E8F5E9; color: var(--green); }

.empty { text-align: center; padding: 44px 20px; color: var(--gray-500); }
.empty i { font-size: 32px; opacity: .4; display: block; margin-bottom: 8px; }

.list-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--gray-100);
}
.list-row:last-child { border-bottom: 0; }
.muted { color: var(--gray-500); font-size: 13px; }

.progress { height: 5px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--purple); border-radius: 999px; transition: width .25s; }

/* ---------- login ---------- */

.login {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--ink); padding: 20px;
}
.login__box { background: var(--white); border-radius: 14px; padding: 34px; width: 100%; max-width: 372px; }
.login__brand { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.login__title { font-size: 13px; color: var(--gray-500); margin-bottom: 22px; }

/* ---------- carta de atributo ---------- */

.card-atr {
    width: 100%; max-width: 320px; background: #F5F2EA; border-radius: 16px;
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: var(--shadow); border: 1px solid var(--gray-100);
}
.card-atr__body { padding: 16px 16px 12px; flex: 1; }
.card-atr__top { display: flex; align-items: center; justify-content: space-between; }
.card-atr__badge {
    width: 30px; height: 30px; border-radius: 50%; background: var(--card-color);
    color: #FFF; display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
}
.card-atr__badge i { font-size: 16px; }
.card-atr__title { text-align: center; margin: 6px 0 12px; }
.card-atr__title h3 {
    color: var(--card-color); font-size: 19px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; line-height: 1.15;
}
.card-atr__num { color: var(--card-color); font-size: 11px; opacity: .75; }
.card-atr__label {
    color: var(--card-color); font-size: 9.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em; text-align: center; margin-bottom: 3px;
}
.card-atr__desc { font-size: 11.5px; line-height: 1.45; text-align: center; color: #33322E; margin-bottom: 12px; }
.card-atr__group { text-align: center; margin-bottom: 10px; }
.card-atr__dot {
    width: 22px; height: 22px; border-radius: 50%; background: var(--card-soft);
    color: #FFF; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 3px;
}
.card-atr__dot i { font-size: 13px; }
.card-atr__values { font-size: 11.5px; color: #33322E; }
.card-atr__tip { background: var(--card-soft); padding: 11px 16px; color: #FFF; }
.card-atr__tip .card-atr__label { color: #FFF; }
.card-atr__tip p { font-size: 10.5px; line-height: 1.4; font-style: italic; text-align: center; }
.card-atr__foot {
    background: var(--card-color); padding: 7px 14px;
    display: flex; align-items: center; justify-content: space-between;
}
.card-atr__foot .coop-logo { filter: brightness(0) invert(1); }
.card-atr__foot span { color: rgba(255, 255, 255, .8); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }

.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; justify-items: center; }

/* ---------- sessao de cartas ---------- */

.play { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }
.play__stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.play__actions { display: flex; gap: 10px; }
.play__btn {
    display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 11px 22px; border-radius: 10px; border: 2px solid var(--gray-300);
    background: var(--white); cursor: pointer; font-family: inherit;
    font-size: 13px; font-weight: 600; color: var(--gray-700); transition: all .15s;
}
.play__btn:hover { transform: translateY(-1px); }
.play__btn i { font-size: 20px; }
.play__btn--is:hover, .play__btn--is.is-on { border-color: var(--green); color: var(--green); background: #F1F8F2; }
.play__btn--is_not:hover, .play__btn--is_not.is-on { border-color: var(--red); color: var(--red); background: #FDF1EF; }
.play__btn--discard:hover, .play__btn--discard.is-on { border-color: var(--gray-500); color: var(--gray-700); background: var(--gray-100); }

/* ---------- etapas ---------- */

.steps { display: flex; gap: 8px; list-style: none; flex-shrink: 0; }
.steps__item {
    display: flex; align-items: center; gap: 7px; padding: 6px 12px;
    border-radius: 999px; font-size: 13px; color: var(--gray-500);
    background: var(--gray-100); white-space: nowrap;
}
.steps__item span {
    width: 19px; height: 19px; border-radius: 50%; background: var(--gray-300);
    color: var(--white); font-size: 11px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
.steps__item.is-on { background: var(--purple); color: var(--white); }
.steps__item.is-on span { background: rgba(255, 255, 255, .3); }
.steps__item.is-done { background: #E8F5E9; color: var(--green); }
.steps__item.is-done span { background: var(--green); }

/* ---------- etapa 1: triagem ---------- */

.triage { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.triage__bar { width: 100%; max-width: 520px; }
.triage__tally {
    display: flex; gap: 16px; justify-content: center;
    margin-top: 10px; font-size: 13px; color: var(--gray-500);
}
.triage__tally i { font-size: 14px; vertical-align: -2px; }
.triage__stage { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.triage__card { display: flex; justify-content: center; }

/* Os dois destinos da triagem, com a cara dos cards pretos do baralho. */
.triage__actions { display: flex; gap: 12px; width: 100%; max-width: 520px; }
.zone-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px 12px; border-radius: 14px; border: 2px solid transparent;
    background: var(--ink); color: var(--paper); cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 400;
    transition: transform .1s, border-color .15s;
    min-height: 44px;
}
.zone-btn strong { font-weight: 700; }
.zone-btn__icon {
    width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--paper);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.zone-btn__icon i { font-size: 20px; }
.zone-btn:active { transform: scale(.97); }
.zone-btn--is.is-on { border-color: #5FD07A; }
.zone-btn--is.is-on .zone-btn__icon { background: #5FD07A; border-color: #5FD07A; color: var(--ink); }
.zone-btn--is_not.is-on { border-color: #E8705F; }
.zone-btn--is_not.is-on .zone-btn__icon { background: #E8705F; border-color: #E8705F; color: var(--ink); }

.triage__nav { display: flex; gap: 10px; align-items: center; }
.triage__hint { font-size: 12px; }
.triage__go { text-align: center; margin-top: 4px; }

/* ---------- etapa 2: selecao ---------- */

.select { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.select__stage { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.select__lead { width: 100%; }
.select__card { display: flex; justify-content: center; }
.select__hint { font-size: 12px; }

.select__meter {
    margin-top: 12px; padding: 9px 13px; border-radius: 8px;
    background: var(--gray-100); color: var(--gray-700); font-size: 14px;
}
.select__meter strong { font-size: 19px; }
.select__meter.is-ok { background: #E8F5E9; color: var(--green); }
.select__meter.is-over { background: #FDECEA; color: var(--red); }
.select__warn { display: block; font-size: 12px; margin-top: 2px; }

.select__list { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 6px; }
.select__row {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 11px 12px; border-radius: 10px; cursor: pointer;
    background: var(--white); border: 1px solid var(--gray-100);
    font-family: inherit; font-size: 14px; text-align: left; color: var(--ink);
    transition: border-color .15s, opacity .15s;
    min-height: 44px;
}
.select__row:hover { border-color: var(--gray-300); }
.select__row.is-current { border-color: var(--purple); }
.select__row.is-out { opacity: .45; }
.select__row.is-out .select__name { text-decoration: line-through; }
.select__row.is-star { border-color: var(--amber); background: #FFFCF6; }
.select__row.is-star .select__toggle--star { color: var(--amber); }

.select__legend {
    font-size: 12px; color: var(--gray-500); line-height: 1.45;
    padding: 9px 11px; background: var(--gray-100); border-radius: 8px; margin-bottom: 4px;
}
.select__legend i { font-size: 14px; vertical-align: -2px; color: var(--amber); }
.select__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--row, #888); flex-shrink: 0; }
.select__name { flex: 1; font-weight: 500; }
.select__toggle {
    width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-500); font-size: 15px;
}
.select__toggle:hover { background: var(--gray-100); color: var(--ink); }
.select__foot { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }

.play__side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.play__count { font-size: 13px; color: var(--gray-500); display: flex; justify-content: space-between; }

.grid-mode { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.grid-mode__item { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.grid-mode__item .card-atr { transform: scale(.94); transform-origin: top center; }
.mini-actions { display: flex; gap: 5px; }
.mini-actions button {
    width: 34px; height: 30px; border-radius: 7px; border: 1px solid var(--gray-300);
    background: var(--white); cursor: pointer; color: var(--gray-500); font-size: 15px;
}
.mini-actions button.is-on[data-c="yes"] { background: var(--green); border-color: var(--green); color: #FFF; }
.mini-actions button.is-on[data-c="maybe"] { background: var(--amber); border-color: var(--amber); color: #FFF; }
.mini-actions button.is-on[data-c="no"] { background: var(--red); border-color: var(--red); color: #FFF; }

/* ---------- arquetipo ---------- */

.arch {
    display: grid; grid-template-columns: minmax(300px, 420px) 1fr;
    gap: 28px; align-items: center; margin-bottom: 16px; padding: 22px 26px;
}
.arch__wheel { display: flex; justify-content: center; }
.wheel { width: 100%; height: auto; }

.arch__read { display: flex; flex-direction: column; }
.arch__name {
    font-size: 34px; font-weight: 700; letter-spacing: -.02em;
    line-height: 1.1; margin: 10px 0 2px;
}
.arch__role {
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em;
    color: var(--gray-500); font-weight: 500;
}
.arch__desc { font-size: 15px; color: var(--gray-700); line-height: 1.5; margin-top: 4px; }
.arch__second {
    margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--gray-100);
}
.arch__second h3 { font-size: 20px; font-weight: 600; margin-top: 1px; }
.arch__tip {
    margin-top: 14px; padding: 10px 13px; border-radius: 8px;
    background: #FFF8EE; color: var(--amber); font-size: 13px; line-height: 1.45;
}
.arch__tip i { font-size: 15px; vertical-align: -2px; }
.arch__axes { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--gray-100); }
.arch__note { font-size: 11.5px; margin-top: 12px; }

/* ---------- resultado ---------- */

.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.results__col { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 15px; }
.results__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.results__head h2 { font-size: 15px; }
.results__pill { width: 9px; height: 9px; border-radius: 50%; }
.results__item { padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.results__item:last-child { border-bottom: 0; }
.results__item small { color: var(--gray-500); }
.axis-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; font-size: 13px; }
.axis-bar__track { flex: 1; height: 7px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.axis-bar__fill { height: 100%; border-radius: 999px; }

@media print {
    .sidebar, .btn, .play__actions, .mini-actions { display: none !important; }
    .main { padding: 0; max-width: none; }
}

@media (max-width: 1024px) {
    .select { grid-template-columns: 1fr; }
    .select__list { position: static; }
    .arch { grid-template-columns: 1fr; }
    .results { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    /* No celular a navegacao vira barra fixa embaixo, ao alcance do polegar. */
    .shell { flex-direction: column; }
    .sidebar {
        position: fixed; bottom: 0; left: 0; right: 0; top: auto;
        width: 100%; height: auto; z-index: 20;
        flex-direction: row; align-items: center; justify-content: space-around;
        padding: 6px 8px; gap: 0;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
    .sidebar__brand, .sidebar__user { display: none; }
    .sidebar__nav { flex-direction: row; flex: 1; justify-content: space-around; gap: 0; }
    .sidebar__nav a {
        flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 10px;
        min-width: 60px; justify-content: center;
    }
    .sidebar__nav a.is-active { background: transparent; color: var(--white); }
    .sidebar__nav a.is-active i { color: var(--purple-soft); }
    .sidebar__nav i { font-size: 21px; }
    .sidebar__foot { border-top: 0; padding-top: 0; gap: 0; }

    .main { padding: 16px 14px 92px; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .steps { width: 100%; }
    .steps__item { flex: 1; justify-content: center; }

    .grid[style*="320px"], .grid[style*="300px"] { grid-template-columns: 1fr !important; }
    .play, .arch { grid-template-columns: 1fr; }

    /* A carta e o conteudo: no celular ela ocupa a largura toda. */
    .card-atr { max-width: 100%; }
    .triage__card, .select__card { width: 100%; }
    .zone-btn { padding: 14px 8px; font-size: 12px; }

    /* A carta e alta: sem isto os dois botoes ficam abaixo da dobra e classificar
       exigiria rolar a carta inteira a cada vez. Grudados embaixo, ficam sempre no
       polegar - logo acima da barra de navegacao. */
    .triage__actions {
        position: sticky; bottom: calc(60px + env(safe-area-inset-bottom));
        z-index: 10; max-width: 100%; padding: 10px 0;
        background: linear-gradient(to top, var(--gray-50) 72%, transparent);
    }

    h1 { font-size: 21px; }
    .results__col { padding: 13px; }
}

@media (max-width: 420px) {
    .zone-btn__icon { width: 34px; height: 34px; }
    .zone-btn__icon i { font-size: 17px; }
    .card-atr__desc, .card-atr__values { font-size: 12px; }
}
