/* Coopera — tokens extraídos do style.css oficial do SSO Sicoob (vds5r). */
:root {
  --ink: #003641;
  --teal: #00ae9d;
  --lime: #7db61c;
  --yellow: #c9d200;

  --g50: #f7f7f7;
  --g100: #ebedf1;
  --g200: #d5dae2;
  --g300: #b1bbc8;
  --g400: #8695aa;
  --g500: #677890;
  --g600: #526077;
  --g700: #434e61;
  --g900: #343a46;

  --danger: #c62828;
  --danger-bg: #fdecec;
  --danger-border: #ef9a9a;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 16px;
  --shadow-action: 0 0 1px 0 rgb(0 30 36 / 24%), 0 2px 1px 1px rgb(0 30 36 / 24%);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #fff;
  color: var(--g900);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* ---------- container ---------- */
.app {
  max-width: 420px;
  margin: 0 auto;
  padding: 34px 26px 40px;
  overflow-x: hidden; /* impede rolagem lateral no "shake" do campo errado */
}
.brand { margin-bottom: 26px; }
.brand img { display: block; height: 30px; width: auto; }
.card { display: flex; flex-direction: column; }
/* display:flex acima venceria o atributo hidden do <form> */
.card[hidden], .step[hidden], .zero[hidden], form[hidden] { display: none !important; }

/* ---------- radios de tipo ---------- */
.types {
  border: 0; padding: 0; margin: 0 0 6px;
  display: flex; flex-direction: column; gap: 9px;
}
.radio {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--g700); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.radio input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin: 0; flex: none;
  border: 2px solid var(--g300); border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color .15s ease;
}
.radio input::after {
  content: "";
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink);
  transform: scale(0);
  transition: transform .12s ease;
}
.radio input:checked { border-color: var(--ink); }
.radio input:checked::after { transform: scale(1); }
.radio input:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.radio:has(input:checked) { color: var(--ink); font-weight: 600; }

hr.divider, .divider {
  border: 0; border-top: 1px solid var(--g200);
  margin: 18px 0 4px;
}

/* ---------- passos ---------- */
.steps { position: relative; }
.step { display: flex; flex-direction: column; }
.step[hidden] { display: none; }
.step.in { animation: stepIn .26s cubic-bezier(.22, .61, .36, 1) both; }
.step.out-left { animation: stepOutLeft .22s ease-in both; }
@keyframes stepIn {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stepOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-22px); }
}
@media (prefers-reduced-motion: reduce) {
  .step.in, .step.out-left { animation: none; }
  .btn .spinner { animation-duration: 1s; }
}

/* ---------- campos ---------- */
.field { margin-top: 18px; }
.field[hidden] { display: none; }
.field > label {
  display: block;
  font-size: 13.5px; font-weight: 600; color: var(--g900);
  margin-bottom: 7px;
}
.field input, .field select {
  width: 100%; height: 46px;
  padding: 0 13px;
  font: inherit; font-size: 15px; color: var(--g900);
  background: #fff;
  border: 1px solid var(--g300);
  border-radius: var(--r-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23677890' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
.field input::placeholder { color: var(--g400); }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(0 174 157 / 18%);
}

/* senha com olho */
.input-wrap { position: relative; }
.input-wrap input { padding-right: 46px; }
.eye {
  position: absolute; top: 0; right: 0; height: 46px; width: 44px;
  display: grid; place-items: center;
  background: none; border: 0; color: var(--g500); cursor: pointer;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.eye:active { background: var(--g100); }

/* ---------- erro ---------- */
.hint { margin: 8px 0 0; font-size: 13px; color: var(--g500); }
.hint.error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--r-xs);
  padding: 8px 10px;
}
.hint.error[hidden] { display: none; }
.field.invalid input {
  border-color: var(--danger);
  background: #fffafa;
}
.field.invalid input:focus { box-shadow: 0 0 0 3px rgb(198 40 40 / 14%); }
.field.shake .input-wrap, .field.shake > input, .field.shake > select {
  animation: tilt .5s cubic-bezier(.36, .07, .19, .97) both;
  border-color: var(--danger) !important;
}
@keyframes tilt {
  0%   { transform: translateX(0) rotate(0); }
  15%  { transform: translateX(-6px) rotate(-1.6deg); }
  30%  { transform: translateX(5px) rotate(1.4deg); }
  45%  { transform: translateX(-4px) rotate(-1deg); }
  60%  { transform: translateX(3px) rotate(.7deg); }
  75%  { transform: translateX(-2px) rotate(-.4deg); }
  100% { transform: translateX(0) rotate(0); }
}

/* ---------- botão ---------- */
.btn {
  margin-top: 26px;
  width: 100%; height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 700;
  letter-spacing: .1px;
  color: #fff; background: var(--ink);
  border: 0; border-radius: var(--r-xs);
  box-shadow: var(--shadow-action);
  cursor: pointer; text-decoration: none;
  transition: filter .15s ease, transform .06s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.btn[disabled] { opacity: .75; cursor: progress; }
.btn .spinner {
  width: 16px; height: 16px; flex: none;
  border: 2px solid rgb(255 255 255 / 40%);
  border-top-color: #fff; border-radius: 50%;
  display: none;
  animation: spin .7s linear infinite;
}
.btn.busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.linkback {
  margin: 14px auto 0; padding: 6px 10px;
  background: none; border: 0; color: var(--g500);
  font: inherit; font-size: 13.5px; cursor: pointer;
}
.linkback:hover { color: var(--ink); }

/* ---------- passo 2/3 ---------- */
.who {
  margin: 4px 0 0; padding: 10px 12px;
  background: var(--g50); border: 1px solid var(--g100); border-radius: var(--r-sm);
  font-size: 13px; color: var(--g700); word-break: break-all;
}
.ok-icon {
  width: 60px; height: 60px; margin: 6px auto 2px;
  display: grid; place-items: center;
  color: #fff; background: var(--teal); border-radius: 50%;
  animation: pop .35s cubic-bezier(.22, 1.2, .36, 1) both;
}
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ok-title { font-size: 19px; color: var(--ink); text-align: center; margin: 14px 0 4px; }
.step-3 .hint { text-align: center; }
.btn-wa { background: #25d366; color: #062b16; box-shadow: 0 0 1px rgb(0 30 36 / 24%), 0 2px 1px 1px rgb(0 30 36 / 18%); }

.foot {
  margin: 30px 0 0; text-align: center;
  font-size: 11px; color: var(--g400);
}

/* avisos de tipo indisponível */
.note {
  margin: 10px 0 0; padding: 9px 11px;
  font-size: 13px; color: var(--g700);
  background: #fffbe6; border: 1px solid #f0e2a3; border-radius: var(--r-xs);
}
.note[hidden] { display: none; }
.note b { color: var(--ink); }

/* ---------- passo 0 / loader / aviso ---------- */
.zero { display: flex; flex-direction: column; }
.zero-title { font-size: 21px; line-height: 1.25; color: var(--ink); margin: 0 0 8px; font-weight: 700; }
.zero-sub { margin: 0 0 4px; font-size: 14px; color: var(--g600); line-height: 1.5; }

.step.loading { align-items: center; padding: 46px 0 40px; }
.loader {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--g200); border-top-color: var(--teal);
  animation: spin .8s linear infinite;
}
.loading-text { margin: 18px 0 0; font-size: 14.5px; color: var(--g700); }

.step.notice { align-items: center; text-align: center; padding: 8px 0 0; }
.notice-icon {
  width: 54px; height: 54px; display: grid; place-items: center;
  color: var(--ink); background: #e6f7f5; border-radius: 50%;
}
.notice-text { margin: 16px 0 0; font-size: 15px; color: var(--g900); line-height: 1.5; }
