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

:root {
  --bg: #0d0f13;
  --surface: #171a20;
  --surface-input: #101217;

  --border: #292e37;
  --border-hover: #383f4a;

  --text: #f2f3f5;
  --text-secondary: #9da4af;
  --text-muted: #686f7b;

  --primary: #001aff;
  --primary-hover: #ddb52f;

  --error-bg: rgba(220, 70, 70, 0.1);
  --error-border: rgba(220, 70, 70, 0.3);
  --error-text: #f0a6a6;

  --success-bg: rgba(60, 180, 110, 0.1);
  --success-border: rgba(60, 180, 110, 0.3);
  --success-text: #8bd3a8;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  background: var(--bg);
  color: var(--text);

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  line-height: 1.5;
}

/* =========================
   LAYOUT
========================= */

main {
  width: min(1000px, calc(100% - 32px));

  margin: 0 auto;

  padding: 40px 0 70px;
}

/* =========================
   HEADER
========================= */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 30px;
  padding-bottom: 22px;

  border-bottom: 1px solid var(--border);
}

header h1 {
  color: var(--primary);

  font-size: 30px;
  font-weight: 700;

  letter-spacing: 0.5px;
}

header p {
  margin-top: 3px;

  color: var(--text-secondary);

  font-size: 15px;
}

header a {
  flex-shrink: 0;

  padding: 9px 15px;

  color: var(--text-secondary);

  border: 1px solid var(--border);
  border-radius: 7px;

  text-decoration: none;

  font-size: 14px;

  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

header a:hover {
  color: var(--text);

  background: var(--surface);

  border-color: var(--border-hover);
}

/* =========================
   MENSAGENS
========================= */

.mensagem {
  margin-bottom: 20px;

  padding: 13px 16px;

  border-radius: 8px;

  font-size: 14px;
}

.mensagem-erro {
  color: var(--error-text);

  background: var(--error-bg);

  border: 1px solid var(--error-border);
}

.mensagem-sucesso {
  color: var(--success-text);

  background: var(--success-bg);

  border: 1px solid var(--success-border);
}

/* =========================
   FORMULÁRIO
========================= */

form {
  display: flex;
  flex-direction: column;

  gap: 20px;
}

/* =========================
   SEÇÕES
========================= */

section {
  padding: 24px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 11px;
}

section h2 {
  margin-bottom: 22px;
  padding-bottom: 13px;

  border-bottom: 1px solid var(--border);

  color: var(--text);

  font-size: 17px;
  font-weight: 600;
}

/* =========================
   GRID
========================= */

.grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 18px;
}

.campo {
  min-width: 0;
}

.campo-full {
  grid-column: 1 / -1;
}

/* =========================
   LABEL
========================= */

label {
  display: block;

  margin-bottom: 7px;

  color: var(--text-secondary);

  font-size: 14px;
  font-weight: 500;
}

/* =========================
   INPUTS
========================= */

input,
select,
textarea {
  width: 100%;
  height: 43px;

  padding: 0 12px;

  background: var(--surface-input);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 7px;

  outline: none;

  font-family: inherit;
  font-size: 14px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

textarea {
  height: auto;

  min-height: 100px;

  padding: 10px 12px;

  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-hover);
}

input:focus,
select:focus,
textarea:focus {
  background: #11141a;

  border-color: var(--primary);

  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

/* =========================
   SELECT
========================= */

select {
  cursor: pointer;

  appearance: auto;
}

/* =========================
   BOTÃO
========================= */

form > button {
  width: 100%;
  height: 46px;

  margin-top: 2px;

  background: var(--primary);
  color: #111;

  border: none;
  border-radius: 7px;

  font-family: inherit;
  font-size: 15px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.1s ease;
}

form > button:hover {
  background: var(--primary-hover);
}

form > button:active {
  transform: translateY(1px);
}

/* =========================
   CAMPOS INVÁLIDOS
========================= */

input:invalid:not(:placeholder-shown) {
  border-color: rgba(220, 70, 70, 0.55);
}

/* =========================
   AUTOFILL
========================= */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);

  -webkit-box-shadow: 0 0 0 1000px var(--surface-input) inset;

  transition: background-color 5000s ease-in-out 0s;
}

/* =========================
   RESPONSIVO
========================= */

@media (max-width: 700px) {
  main {
    width: min(100% - 20px, 1000px);

    padding-top: 22px;
    padding-bottom: 40px;
  }

  header {
    align-items: flex-start;

    flex-direction: column;

    margin-bottom: 22px;
  }

  header h1 {
    font-size: 26px;
  }

  header a {
    width: 100%;

    text-align: center;
  }

  section {
    padding: 19px;
  }

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

    gap: 16px;
  }

  .campo-full {
    grid-column: auto;
  }
}

/* =========================
   CELULAR PEQUENO
========================= */

@media (max-width: 400px) {
  main {
    width: calc(100% - 16px);
  }

  section {
    padding: 16px;
  }

  section h2 {
    font-size: 16px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}
