/* IN BEAUTY — portal de submissões
   Paleta retirada de exponor.pt/in-beauty */
:root {
    --ib-burgundy: #802d56;
    --ib-rose: #bd4c68;
    --ib-rose-dark: #a33f59;
    --ib-navy: #2e3d67;
    --ib-ink: #090c29;
    --ib-violet: #9e55e0;
    --ib-text: #3d3d3d;
    --ib-muted: #9a9a9a;
    --ib-line: #e4dfe3;
    --ib-soft: #f6f3f5;
    --ib-white: #fff;
    --ib-success: #2f8f6b;
    --ib-danger: #b3261e;
    --ib-gradient: linear-gradient(61deg, #802d56 9%, #bd4c68 55%, #f3dbe2 100%);
    --radius: 10px;
    --shadow: 0 10px 30px rgba(9, 12, 41, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Blinker", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: var(--ib-text);
    background: var(--ib-soft);
}
a { color: var(--ib-rose); }
h1, h2, h3 { font-weight: 700; color: var(--ib-ink); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
.muted { color: var(--ib-muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: baseline; gap: .1em; text-decoration: none; font-weight: 700; letter-spacing: .02em; color: inherit; }
.brand__in { font-weight: 300; }
.brand__beauty { text-transform: uppercase; letter-spacing: .14em; }
.brand__tag { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; opacity: .7; margin-left: .8em; font-weight: 600; }
.brand img { height: 34px; display: block; }

/* ---------- Topbar ---------- */
.topbar { background: var(--ib-ink); color: var(--ib-white); }
.topbar__inner { max-width: 1200px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 24px; }
.topbar .brand { font-size: 1.5rem; }
.topbar nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topbar nav a, .topbar nav button {
    color: rgba(255,255,255,.8); text-decoration: none; padding: 8px 12px; border-radius: 8px; font: inherit; font-weight: 600;
    background: none; border: 0; cursor: pointer;
}
.topbar nav a:hover, .topbar nav button:hover, .topbar nav a.is-active { color: #fff; background: rgba(255,255,255,.1); }
.topbar__user { font-size: .875rem; color: rgba(255,255,255,.6); padding: 0 8px; }
.topbar__bar { height: 4px; background: var(--ib-gradient); }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 16px 64px; }
.container--narrow { max-width: 920px; }
.container--wide { max-width: 1600px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 0; }
.card { background: var(--ib-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 20px; }
.grid { display: grid; gap: 16px; }
.footer { text-align: center; color: var(--ib-muted); font-size: .8rem; padding: 24px 16px 40px; }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .95rem;
    padding: 12px 22px; border-radius: var(--radius); border: 2px solid var(--ib-rose);
    background: var(--ib-rose); color: #fff; text-decoration: none; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: #fff; color: var(--ib-rose); }
.btn:disabled, .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn--ghost { background: transparent; color: var(--ib-rose); }
.btn--ghost:hover { background: var(--ib-rose); color: #fff; }
.btn--navy { background: var(--ib-navy); border-color: var(--ib-navy); }
.btn--navy:hover { color: var(--ib-navy); }
.btn--sm { padding: 7px 12px; font-size: .78rem; }
.btn--block { width: 100%; }
.btn--link { background: none; border: 0; color: var(--ib-rose); padding: 0; text-transform: none; letter-spacing: 0; font-weight: 600; }
.btn--link:hover { background: none; color: var(--ib-burgundy); text-decoration: underline; }
.btn--danger { color: var(--ib-danger); }
.btn-ms { background: #fff; color: var(--ib-ink); border: 1px solid #c9c4c8; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 1.05rem; }
.btn-ms:hover { background: #f4f1f3; color: var(--ib-ink); }
.btn-ms svg { width: 20px; height: 20px; }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label, .label { font-weight: 700; color: var(--ib-ink); font-size: .95rem; }
.req { color: var(--ib-rose); }
.input, select.input, textarea.input {
    font: inherit; width: 100%; padding: 11px 14px; border: 1.5px solid var(--ib-line); border-radius: 8px;
    background: #fff; color: var(--ib-text); transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ib-rose); box-shadow: 0 0 0 3px rgba(189, 76, 104, .15); }
.input.is-invalid { border-color: var(--ib-danger); }
.error { color: var(--ib-danger); font-size: .875rem; font-weight: 600; }
.hint { color: var(--ib-muted); font-size: .85rem; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { accent-color: var(--ib-rose); width: 16px; height: 16px; }

/* ---------- Alertas ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; border-left: 4px solid; }
.alert--success { background: #e7f4ee; border-color: var(--ib-success); color: #1d5c44; }
.alert--error { background: #fbeaea; border-color: var(--ib-danger); color: #7d1c16; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login__hero {
    background: var(--ib-gradient); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden;
}
.login__hero::after {
    content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%;
    border: 60px solid rgba(255,255,255,.12);
}
.login__hero .brand { font-size: 2.2rem; color: #fff; }
.login__hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.2rem); max-width: 12ch; text-transform: uppercase; letter-spacing: .02em; }
.login__hero p { max-width: 42ch; font-size: 1.1rem; opacity: .92; }
.login__panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login__box { width: 100%; max-width: 380px; }
.login__box h2 { font-size: 1.6rem; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ib-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin: 28px 0 18px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--ib-line); }
details.admin-login summary { cursor: pointer; color: var(--ib-navy); font-weight: 700; list-style: none; text-align: center; }
details.admin-login summary::-webkit-details-marker { display: none; }
details.admin-login[open] summary { margin-bottom: 18px; }
@media (max-width: 820px) {
    .login { grid-template-columns: 1fr; }
    .login__hero { padding: 32px 16px; min-height: 260px; }
}

/* ---------- Stepper ---------- */
.stepper { display: flex; list-style: none; padding: 0; margin: 0 0 28px; counter-reset: step; }
.stepper li { flex: 1; position: relative; text-align: center; font-weight: 700; font-size: .9rem; color: var(--ib-muted); }
.stepper li::before {
    counter-increment: step; content: counter(step);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; width: 40px; height: 40px; border-radius: 50%;
    background: #fff; border: 2px solid var(--ib-line); color: var(--ib-muted); position: relative; z-index: 1; font-size: 1.05rem;
}
.stepper li::after { content: ""; position: absolute; top: 20px; left: -50%; width: 100%; height: 2px; background: var(--ib-line); }
.stepper li:first-child::after { display: none; }
.stepper li.is-done::before { content: "✓"; background: var(--ib-burgundy); border-color: var(--ib-burgundy); color: #fff; }
.stepper li.is-done::after, .stepper li.is-current::after { background: var(--ib-burgundy); }
.stepper li.is-current { color: var(--ib-ink); }
.stepper li.is-current::before { background: var(--ib-rose); border-color: var(--ib-rose); color: #fff; box-shadow: 0 0 0 5px rgba(189,76,104,.18); }
.stepper a { color: inherit; text-decoration: none; }
.stepper small { display: block; font-weight: 400; color: var(--ib-muted); }
.step-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- Dropzone ---------- */
.dropzone {
    display: block; margin-top: 20px;
    border: 2px dashed #d8c4cd; border-radius: var(--radius); background: #fdf8fa; padding: 40px 16px; text-align: center; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--ib-rose); background: #fbeef2; }
.dropzone svg { display: block; margin: 0 auto; width: 48px; height: 48px; color: var(--ib-rose); }
.dropzone > span { display: block; }
.dropzone strong { display: block; font-size: 1.15rem; color: var(--ib-ink); margin: 8px 0 4px; }
.types { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Ficheiros ---------- */
.files { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.file { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--ib-line); border-radius: 8px; background: #fff; }
.file__thumb { width: 52px; height: 52px; flex: none; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--ib-soft); }
.file__thumb img { width: 100%; height: 100%; object-fit: cover; }
.file__info { min-width: 0; flex: 1; }
.file__name { font-weight: 700; color: var(--ib-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__meta { font-size: .85rem; color: var(--ib-muted); }
.file__progress { height: 6px; background: var(--ib-soft); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.file__progress span { display: block; height: 100%; width: 0; background: var(--ib-gradient); transition: width .2s; }
.file.is-error { border-color: var(--ib-danger); background: #fdf3f3; }
.file.is-error .file__meta { color: var(--ib-danger); font-weight: 600; }
.icon-btn { border: 0; background: none; color: var(--ib-muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.icon-btn:hover { color: var(--ib-danger); background: #fbeaea; }

/* Tipo de ficheiro */
.kind { display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 5px; padding: 3px 7px; color: #fff; }
.kind--image { background: var(--ib-rose); }
.kind--pdf { background: #c0392b; }
.kind--excel { background: #217346; }
.kind--word { background: #2b579a; }
.kind--video { background: var(--ib-violet); }
.file__thumb .kind { font-size: .62rem; }

/* ---------- Legendas (passo 2) ---------- */
.caption-card { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 16px; border: 1px solid var(--ib-line); border-radius: var(--radius); background: #fff; }
.caption-card + .caption-card { margin-top: 14px; }
.caption-card__preview { aspect-ratio: 4/3; border-radius: 8px; background: var(--ib-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; }
.caption-card__preview img, .caption-card__preview video { width: 100%; height: 100%; object-fit: cover; }
.caption-card .field { margin: 0; }
.counter { text-align: right; font-size: .78rem; color: var(--ib-muted); }
@media (max-width: 640px) { .caption-card { grid-template-columns: 1fr; } }

/* ---------- Membros (tags) ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border: 1.5px solid var(--ib-line); border-radius: 8px; background: #fff; }
.tags:focus-within { border-color: var(--ib-rose); box-shadow: 0 0 0 3px rgba(189, 76, 104, .15); }
.tag { display: inline-flex; align-items: center; gap: 6px; background: #f6e7ec; color: var(--ib-burgundy); border-radius: 999px; padding: 4px 6px 4px 12px; font-weight: 600; }
.tag button { border: 0; background: rgba(128,45,86,.12); color: var(--ib-burgundy); border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1; }
.tags input { border: 0; outline: 0; flex: 1; min-width: 160px; font: inherit; padding: 4px; }
.autocomplete { position: relative; }
.suggestions {
    position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none;
    background: #fff; border: 1px solid var(--ib-line); border-radius: 8px; box-shadow: var(--shadow); max-height: 320px; overflow-y: auto;
}
.suggestions li { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.suggestions li strong { color: var(--ib-ink); }
.suggestions li span { font-size: .82rem; color: var(--ib-muted); }
.suggestions li:hover, .suggestions li.is-active { background: #f6e7ec; }
.suggestions li.is-active strong { color: var(--ib-burgundy); }

/* ---------- Tabelas / admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border-top: 4px solid var(--ib-rose); }
.stat:nth-child(2) { border-color: var(--ib-navy); }
.stat:nth-child(3) { border-color: var(--ib-violet); }
.stat b { display: block; font-size: 2rem; color: var(--ib-ink); line-height: 1; }
.stat span { font-size: .85rem; color: var(--ib-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-bottom: 20px; }
.filters .field { margin: 0; }
.filters .input { padding: 8px 10px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ib-muted); padding: 10px 12px; border-bottom: 2px solid var(--ib-line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--ib-line); vertical-align: middle; }
.table tr:hover td { background: #fdf8fa; }
.table .actions { white-space: nowrap; text-align: right; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin: 18px 0 12px; }
.toolbar > div { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge--ok { background: #e7f4ee; color: #1d5c44; }
.badge--draft { background: #fff4dc; color: #8a5a00; }
.kinds { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 6px; background: #fff; border: 1px solid var(--ib-line); text-decoration: none; color: var(--ib-text); }
.pagination .is-current { background: var(--ib-rose); color: #fff; border-color: var(--ib-rose); }
.pagination .is-disabled { opacity: .4; }

dl.meta { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; }
dl.meta dt { font-weight: 700; color: var(--ib-ink); }
dl.meta dd { margin: 0; }
@media (max-width: 640px) { dl.meta { grid-template-columns: 1fr; } dl.meta dd { margin-bottom: 8px; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.asset-card { border: 1px solid var(--ib-line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.asset-card__media { aspect-ratio: 4/3; background: var(--ib-soft); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; }
.asset-card__media img, .asset-card__media video { width: 100%; height: 100%; object-fit: cover; }
.asset-card__body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.asset-card__body p { margin: 0; }
.asset-card__foot { padding: 10px 14px; border-top: 1px solid var(--ib-line); display: flex; justify-content: space-between; align-items: center; }
.empty { text-align: center; padding: 48px 16px; color: var(--ib-muted); }
