/* ============
   Formulários Zammad — UMinho
   Autor: Filipe Freitas
   Finalidade: Estilos base responsivos, acessíveis e prontos para iFrame
   ============ */

/* 1) Reset simples e tipografia */
:root{
  --bg: transparent;       /* Fundo da página fica invisível */
  --fg: #1b1b1b;           /* Texto sempre escuro para contrastar com o SharePoint */
  --muted: #6b7280;
  --primary: #0a66c2;      /* azul acessível */
  --primary-700: #084e93;
  --ring: rgba(10,102,194,.35);
  --border: transparent;   /* Remove a borda da caixa para fundir melhor */
  --error: #b91c1c;
  --ok: #166534;
  --card: transparent;     /* Remove o fundo branco/preto da caixa do formulário */
  --shadow: none;          /* Remove a sombra para ficar 100% plano no site */
}

/* ⚠️ Bloco do Dark Mode FOI REMOVIDO/APAGADO para evitar texto branco invisível */

html, body{
  padding:0; margin:0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.5;
}

/* 2) Content wrapper: centra e limita largura */
.form-wrap{
  box-sizing: border-box;
  max-width: 720px;
  margin: 24px auto;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* 3) Títulos e descrições */
.form-wrap h1{
  margin: 0 0 6px 0;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 700;
}
.form-wrap p.desc{
  margin: 0 0 18px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* 4) Grid responsiva dos campos */
.form-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px){
  .form-grid.two-cols{
    grid-template-columns: 1fr 1fr;
  }
}

/* 5) Labels e campos */
label{
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.input, textarea, input[type="text"], input[type="email"]{
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

textarea{
  min-height: 140px;
  resize: vertical;
}

input::placeholder, textarea::placeholder{
  color: var(--muted);
}

/* Focus visível e acessível */
input:focus, textarea:focus, button:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* Campos inválidos (HTML5) */
input:invalid, textarea:invalid{
  border-color: #f59e0b; /* âmbar para pré-validação */
}

/* 6) Mensagens auxiliares */
.small{
  font-size: .9rem;
  color: var(--muted);
}

/* 7) Botões */
button, .btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform .05s ease, background-color .15s ease, box-shadow .15s ease;
}

button:hover, .btn:hover{
  background: var(--primary-700);
}

button:active, .btn:active{
  transform: translateY(1px);
}

/* 8) Estados de feedback */
.alert{
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.alert.ok{
  background: rgba(22,101,52,.08);
  border-color: rgba(22,101,52,.35);
  color: var(--ok);
}
.alert.err{
  background: rgba(185,28,28,.08);
  border-color: rgba(185,28,28,.35);
  color: var(--error);
}

/* 9) Ajudas utilitárias */
.mt-0{ margin-top:0 }
.mt-8{ margin-top:8px }
.mt-12{ margin-top:12px }
.mt-16{ margin-top:16px }
.hidden{ display:none !important }

/* 10) Ajustes para iFrame: evitar overflow horizontal */
.form-wrap{
  overflow: hidden;
}

/* 11) Link simples coerente com o tema */
a{ color: var(--primary); text-decoration: none; }
a:hover{ text-decoration: underline; }

/* 12) Mensagens de validação personalizadas (opcional) */
input:required:placeholder-shown,
textarea:required:placeholder-shown{
  /* estilo neutro até o utilizador interagir */
}

/* Ajustes específicos para telemóveis */
@media (max-width: 600px) {
  .form-wrap {
    margin: 10px;
    padding: 15px;
  }
}
