/* ============================================================================
   VIANNA'S — css/viannas-e107.css
   Componentes NATIVOS de e107 estilizados com a marca (formulários, botões,
   tabelas, alertas, splash de login/registo). Marcado nativo intacto:
   classes e107 (.form-control, .tbox, .btn, .primary-btn, .table, .alert…)
   mais as classes de marca emitidas por theme.php::tablestyle() (.v-splash…).
============================================================================ */

/* ---------- Página splash (login / registo / recuperar password) ---------- */
body.layout-splash { background: var(--v-mist); color: var(--v-navy); }
body .section.splash { background: var(--v-mist); color: var(--v-navy); padding: clamp(2.2rem, 6vw, 4.5rem) 0; }

body .v-splash {
  background: #fff;
  border: 1px solid rgba(16, 36, 80, 0.14);
  border-radius: 6px;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  box-shadow: 14px 14px 0 rgba(16, 36, 80, 0.07);
  color: var(--v-navy);
}
body .v-splash-title {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  color: var(--v-navy);
  margin: 0 0 1.1rem;
  text-transform: none;
}
body .signup-divider {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: rgba(16, 36, 80, 0.65);
  border-top: 1px solid rgba(16, 36, 80, 0.14);
  text-align: center;
  margin: 1.6rem 0 1.2rem;
}
body .signup-divider span { background: #fff; padding: 0 0.9rem; position: relative; top: -0.75em; }

/* ---------- Formulários nativos e107 ---------- */
body input[type="text"],
body input[type="password"],
body input[type="email"],
body input[type="search"],
body input[type="url"],
body input[type="tel"],
body input[type="number"],
body input[type="date"],
body textarea,
body select,
body .form-control,
body .tbox {
  background-color: #fff;
  color: var(--v-navy);
  border: 1px solid rgba(16, 36, 80, 0.22);
  border-radius: 4px;
  font-family: var(--font-body, "Sora", system-ui, sans-serif);
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.7rem 0.9rem;
  box-shadow: none;
  max-width: 100%;
}
body textarea { min-height: 140px; }
body input:focus,
body textarea:focus,
body select:focus,
body .form-control:focus {
  border-color: var(--v-navy);
  box-shadow: 0 0 0 3px rgba(16, 36, 80, 0.12);
  outline: none;
}
body input::placeholder, body textarea::placeholder { color: rgba(16, 36, 80, 0.45); }
body select.form-control, body select.tbox { appearance: auto; }

/* labels + ajuda */
body label,
body .form-label,
body .control-label {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v-navy);
  margin-bottom: 0.35rem;
}
body .form-text, body .help-block, body .field-help { color: rgba(16, 36, 80, 0.6); font-size: 0.82rem; }
body .form-check-input { accent-color: var(--v-navy); }
body .checkbox label, body .form-check label { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-weight: 400; font-size: 0.92rem; }

/* ---------- Botões nativos e107 ---------- */
body input[type="submit"],
body input[type="button"],
body input[type="reset"],
body button,
body .btn,
body .button,
body .primary-btn {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.3s var(--ease, ease), color 0.3s var(--ease, ease), border-color 0.3s var(--ease, ease);
}
body input[type="submit"],
body input[type="button"],
body .btn-primary,
body .primary-btn { background: var(--v-navy); color: var(--v-creme); }
body input[type="submit"]:hover,
body input[type="button"]:hover,
body .btn-primary:hover,
body .primary-btn:hover { background: var(--v-slate); color: #fff; }
body input[type="reset"],
body .btn-default,
body .btn-secondary {
  background: transparent;
  color: var(--v-navy);
  border-color: rgba(16, 36, 80, 0.35);
}
body .btn-default:hover, body .btn-secondary:hover { background: rgba(16, 36, 80, 0.07); color: var(--v-navy); }

/* ---------- Alertas / mensagens nativas ---------- */
body .alert {
  background: #fff;
  color: var(--v-navy);
  border: 1px solid rgba(16, 36, 80, 0.18);
  border-left: 4px solid var(--v-navy);
  border-radius: 4px;
  padding: 1rem 1.1rem;
}
body .alert-danger { border-left-color: #8c2b2b; background: rgba(140, 43, 43, 0.05); color: #6d2020; }
body .alert-success { border-left-color: #1f6b45; background: rgba(31, 107, 69, 0.05); color: #175336; }
body .alert-info { border-left-color: var(--v-slate); }

/* ---------- Tabelas nativas ---------- */
body table.table, body .table { width: 100%; border-collapse: collapse; color: var(--v-navy); }
body .table th {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.76rem;
  color: var(--v-navy);
  border-bottom: 2px solid rgba(16, 36, 80, 0.2);
  padding: 0.6rem 0.75rem;
}
body .table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(16, 36, 80, 0.12); }

/* ---------- Conteúdo nativo (cpage, news, etc.) ---------- */
body .v-content { color: var(--v-navy); }
body .v-content-title {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 700;
  color: var(--v-navy);
  margin: 0 0 1rem;
}
body .v-content a:not(.btn):not(.nav-link):not(.navbar-brand) { color: var(--v-navy); text-decoration: underline; text-underline-offset: 3px; }
body .v-content a:not(.btn):hover { color: var(--v-slate); }
body .login-page-footer, body .login-page-footer a { color: rgba(16, 36, 80, 0.75); font-size: 0.86rem; }
/* Radios/checkboxes nativos: substituir o verde de Aeolus pela marca */
body .form-check-input,
body input[type="radio"],
body input[type="checkbox"] { accent-color: var(--v-navy); }
body .form-check-input:checked,
body input[type="radio"]:checked,
body input[type="checkbox"]:checked {
  background-color: var(--v-navy) !important;
  border-color: var(--v-navy) !important;
}
body .form-check-input:focus,
body input[type="radio"]:focus,
body input[type="checkbox"]:focus { box-shadow: 0 0 0 3px rgba(16, 36, 80, 0.12) !important; border-color: var(--v-navy) !important; }
body .form-check-label, body .checkbox label { color: var(--v-navy); }

/* Título nativo de e107 (.header-title) na marca */
body .header-title {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 700;
  color: var(--v-navy);
  margin: 0 0 1rem;
}
/* ============================================================================
   Botões nativos: hover/focus sem verde (Bootstrap herdava as variáveis de Aeolus)
============================================================================ */
html, body {
  --bs-primary: #102450;
  --bs-primary-rgb: 16, 36, 80;
  --primary: #102450;
  --primary-dark: #0c1c3c;
  --bs-link-color: #102450;
  --bs-link-color-rgb: 16, 36, 80;
  --bs-link-hover-color: #3B507D;
  --bs-link-hover-color-rgb: 59, 80, 125;
}
body input[type="submit"]:hover,
body input[type="button"]:hover,
body input[type="reset"]:hover,
body button:hover,
body .btn:hover,
body .btn-primary:hover,
body .primary-btn:hover {
  background: var(--v-slate) !important;
  color: #fff !important;
  border-color: transparent !important;
}
body input[type="submit"]:focus,
body input[type="button"]:focus,
body .btn:focus,
body .btn-primary:focus,
body .primary-btn:focus,
body input[type="submit"]:focus-visible,
body .btn-primary:focus-visible,
body .primary-btn:focus-visible {
  border-color: var(--v-slate) !important;
  box-shadow: 0 0 0 3px rgba(16, 36, 80, 0.16) !important;
  outline: none !important;
}
/* botões ghost mantêm a marca */
body .btn-default, body .btn-secondary { border-color: rgba(16, 36, 80, 0.35) !important; }
body .btn-default:hover, body .btn-secondary:hover { background: rgba(16, 36, 80, 0.07) !important; color: var(--v-navy) !important; }

/* ============================================================================
   CAPTCHA nativo e107 (<img class="icon secure-image" src="secimg.php">)
   · tamanho natural (100×35) — a Aeolus esticava a 100% da largura (enorme)
   · painel navy de marca (como o .captcha-code do contacto) em todas as páginas
============================================================================ */
body img.secure-image,
body .secure-image,
body img[src*="secimg.php"],
body img[src*="secimage"] {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  display: inline-block !important;
  background: var(--v-navy) !important;
  padding: 10px 16px !important;
  border-radius: 4px;
  margin: 0 0 6px;
  vertical-align: middle;
}
/* dentro do bloco de marca do contacto não duplicar o painel */
body .contact-captcha .captcha-code img.secure-image,
body .contact-captcha .captcha-code img[src*="secimg.php"],
body .contact-captcha .captcha-code .secure-image {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0;
}
/* ajuda/label do captcha */
body .captcha-help,
body .field-help,
body .contact-captcha .captcha-help {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(16, 36, 80, 0.6);
  margin-top: 6px;
}
body .contact-captcha .captcha-code { margin-bottom: 8px; }

/* ============================================================================
   PÁGINA DE ERRO (404/403/500…) — template do tema (error_template.php)
============================================================================ */
.v-error {
  text-align: center;
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 5vw, 3.5rem);
}
.v-error-code {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 800;
  font-size: clamp(4rem, 13vw, 9rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: var(--v-navy);
  opacity: 0.12;
  margin: 0 0 0.4rem;
}
.v-error-title {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 700;
  color: var(--v-navy);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  margin: 0.4rem 0 0.9rem;
}
.v-error-text {
  color: var(--v-slate);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 62ch;
  margin: 0 auto 1.8rem;
}
.v-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
  align-items: center;
}
.v-error-actions .btn { display: inline-flex; align-items: center; gap: 0.5rem; }

/* O .eyebrow é um contentor flex: text-align não centra os seus itens */
.v-error .eyebrow { justify-content: center; }

/* ============================================================================
   PERFIL DE USUARIO (user.php) — user_template.php «view»
   Adaptação ao branding Vianna's das regras .profile-* do loestudio
============================================================================ */
.user-profile.profile-loe { width: 100%; max-width: none; }

/* ---- Cabeçalho: avatar + identidade ---- */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  background: var(--v-white);
  border: 1px solid var(--v-navy);
  border-left: 4px solid var(--v-navy);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  margin-bottom: 1.6rem;
}
.profile-avatar { flex: 0 0 auto; }
.profile-avatar img {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border: 1px solid var(--v-taupe);
  padding: 5px;
  background: var(--v-white);
}
.profile-identity { flex: 1 1 auto; min-width: 0; }
.profile-identity .eyebrow { color: var(--v-slate); margin-bottom: 0.25rem; }
.profile-identity .eyebrow img { height: 14px; width: auto; vertical-align: -2px; }
.profile-identity h2 {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 700;
  color: var(--v-navy);
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  line-height: 1.1;
  margin: 0.35rem 0 0.5rem;
}
.profile-signature { color: var(--v-slate); font-style: italic; font-size: 0.95rem; }
.profile-actions { margin-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; font-size: 0.85rem; }
.profile-actions:empty { display: none; }

/* ---- Métricas rápidas ---- */
.profile-stats { margin-bottom: 1.6rem; }
.profile-stat {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--v-mist);
  border: 1px solid rgba(186, 182, 166, 0.8);
  border-top: 3px solid var(--v-navy);
  padding: 1.05rem 1rem;
}
.profile-stat .stat-label {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--v-slate);
}
.profile-stat .stat-value {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 700;
  color: var(--v-navy);
  font-size: 1.05rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.profile-stat .stat-value a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(16, 36, 80, 0.3); }
.profile-stat small { color: var(--v-taupe); font-size: 0.72rem; }

/* ---- Ficha de dados ---- */
.profile-card {
  background: var(--v-white);
  border: 1px solid var(--v-navy);
  padding: clamp(1.3rem, 2.6vw, 1.9rem);
  margin-bottom: 1.6rem;
}
.profile-card > .eyebrow { margin-bottom: 0.8rem; }
.profile-row { border-bottom: 1px solid rgba(186, 182, 166, 0.5); padding: 0.7rem 0; margin: 0; }
.profile-row:last-child { border-bottom: 0; }
.profile-label {
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--v-slate);
}
.profile-value { color: var(--v-navy); font-size: 0.95rem; overflow-wrap: anywhere; }
/* linhas sem valor (ex.: nome de login oculto) não aparecem */
.profile-card .profile-row:has(.profile-value:empty) { display: none; }

/* ---- Botão de atualização ---- */
.profile-update { margin: 1.6rem 0 0.6rem; }
.profile-update .btn,
.profile-update a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--v-navy);
  border: 1px solid var(--v-navy);
  border-radius: 3px;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-disp, "League Spartan", sans-serif);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.profile-update .btn:hover,
.profile-update a:hover { background: var(--v-navy); color: var(--v-creme); }

/* ---- Navegação anterior/seguinte + comentários ---- */
.profile-nav { border-top: 1px solid rgba(186, 182, 166, 0.5); padding-top: 1rem; }
.profile-nav a { color: var(--v-navy); text-decoration: none; font-size: 0.85rem; }
.profile-nav a:hover { border-bottom: 1px solid var(--v-taupe); }
.profile-comments { margin-top: 1.6rem; }

/* ---- Responsivo ---- */
@media (max-width: 767.98px) {
  .profile-hero { flex-direction: column; text-align: center; gap: 1.1rem; }
  .profile-actions { justify-content: center; }
  .profile-avatar img { width: 110px; height: 110px; }
}
