:root {
  --primary: #0F766E;
  --primary-dark: #115E59;
  --secondary: #14B8A6;
  --accent: #F59E0B;
  --bg-alt: #ECFDF8;
  --ink: #0E1726;
  --ink-light: #6B7280;
  --line: #E5E7EB;
  --line-soft: #F1F5F9;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #F9FAFB;
  min-height: 100vh;
  color: #1F2937;
  font-size: 14px;
  line-height: 1.55;
}

a { color: #0F766E; text-decoration: none; }
a:hover { text-decoration: underline; }

.rev-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  padding: 16px 0;
  box-shadow: none;
}
.rev-topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rev-topbar-logo img { display: block; height: 32px; width: auto; }
.rev-topbar-logo { color: inherit; }
.rev-topbar-logo:hover { text-decoration: none; }
.rev-topbar-login {
  color: #6B7280;
  font-size: 14px;
  font-weight: 500;
}
.rev-topbar-login:hover { color: #0F766E; text-decoration: none; }

.rev-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 30px 20px 50px;
}

.rev-card {
  background: white;
  border-radius: 12px;
  padding: 36px;
  box-shadow: none;
  border: 1px solid #E5E7EB;
}
.rev-card h1 { margin: 0 0 6px; font-size: 26px; color: #111827; font-weight: 700; letter-spacing: -0.3px; }
.rev-card .subtitle { color: #6B7280; margin: 0 0 22px; font-size: 14px; }

.rev-card-center { text-align: center; }
.rev-card-center .rev-emoji { font-size: 64px; line-height: 1; margin-bottom: 8px; }

.rev-section-title {
  margin: 24px 0 12px;
  font-size: 15px;
  color: #374151;
  font-weight: 600;
  border-bottom: 1px solid #E5E7EB;
  padding-bottom: 8px;
}
.rev-section-title:first-of-type { margin-top: 0; }

.rev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.rev-grid label { display: block; }
.rev-grid label.full { grid-column: 1 / -1; }

label {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
  display: block;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 4px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #FFFFFF;
  color: #1F2937;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #0F766E;
  box-shadow: none;
}
input.is-invalid, textarea.is-invalid, select.is-invalid {
  border-color: #EF4444;
  background: #FEF2F2;
}
input.is-valid, textarea.is-valid, select.is-valid {
  border-color: #0F766E;
}

.field-error {
  display: none;
  margin-top: 4px;
  color: #DC2626;
  font-size: 12px;
}
input.is-invalid + .field-error,
textarea.is-invalid + .field-error,
select.is-invalid + .field-error {
  display: block;
}

.rev-btn {
  display: inline-block;
  padding: 12px 22px;
  background: #0F766E;
  color: white;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  transition: background .15s, transform .05s;
  font-family: inherit;
}
.rev-btn:hover { background: #115E59; text-decoration: none; color: white; }
.rev-btn:active { transform: translateY(1px); }
.rev-btn:disabled { background: #9CA3AF; cursor: not-allowed; }

.rev-btn-ghost {
  background: transparent;
  color: #6B7280;
  border: 1px solid #D1D5DB;
}
.rev-btn-ghost:hover { background: #F9FAFB; color: #374151; }

.rev-btn-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.rev-btn-row-start {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.rev-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}
.rev-alert.ok { background: #ECFDF8; color: #0F766E;  }
.rev-alert.err { background: #FEE2E2; color: #991B1B;  }
.rev-alert.info { background: #DBEAFE; color: #1E40AF;  }

.req { color: #EF4444; }
.muted { color: #6B7280; font-size: 13px; }

.rev-info-box {
  background: #ECFDF8;
  
  border-radius: 8px;
  padding: 14px 16px;
  margin: 24px 0 8px;
}
.rev-info-box p { margin: 0; font-size: 13px; color: #0F766E; line-height: 1.55; }

.rev-benefits {
  margin: 22px 0 26px;
  padding: 0;
  list-style: none;
}
.rev-benefits li {
  padding: 10px 0;
  font-size: 14px;
  color: #4B5563;
  border-bottom: 1px solid #F3F4F6;
}
.rev-benefits li:last-child { border-bottom: 0; }

.rev-success-code {
  background: #ECFDF8;
  border: 1px solid #0F766E;
  border-radius: 12px;
  padding: 22px;
  margin: 22px 0;
  text-align: left;
}
.rev-success-code-label { font-size: 13px; color: #6B7280; }
.rev-success-code-value {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 22px;
  font-weight: 700;
  color: #0F766E;
  margin: 6px 0;
  user-select: all;
}
.rev-success-code-hint { font-size: 12px; color: #6B7280; margin-top: 8px; }

.rev-footer {
  text-align: center;
  color: #9CA3AF;
  padding: 20px;
  font-size: 12px;
}
.rev-footer a { color: #6B7280; }

@media (max-width: 640px) {
  .rev-card { padding: 24px; }
  .rev-grid { grid-template-columns: 1fr; }
  .rev-btn-row { flex-direction: column-reverse; }
  .rev-btn-row .rev-btn { width: 100%; text-align: center; }
}

/* Validador de senha em tempo real */
.pwd-rules {
  margin: 14px 0 18px;
  padding: 14px 16px;
  background: #F9FAFB;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
}
.pwd-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: #6B7280;
  transition: color .15s;
}
.pwd-rule-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #E5E7EB;
  color: #9CA3AF;
  font-size: 11px;
  font-weight: 700;
  transition: background .15s, color .15s;
}
.pwd-rule.is-ok {
  color: #0F766E;
}
.pwd-rule.is-ok .pwd-rule-icon {
  background: #0F766E;
  color: white;
}
.pwd-rule.is-ok .pwd-rule-icon::before { content: '✓'; }
.pwd-rule:not(.is-ok) .pwd-rule-icon::before { content: ''; }

input.is-loading {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'><circle cx='12' cy='12' r='10' stroke='%230F766E' stroke-width='3' fill='none' stroke-dasharray='40' stroke-dashoffset='20'><animateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/></circle></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  padding-right: 36px;
}

/* ============================================================
   Tela de login
   ============================================================ */
.rev-login-wrap {
  max-width: 440px;
  margin: 40px auto;
  padding: 0 16px;
}
.rev-login-card {
  background: white;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: none;
  border: 1px solid #E5E7EB;
}
.rev-login-header {
  text-align: center;
  margin-bottom: 24px;
}
.rev-login-emoji {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 8px;
}
.rev-login-header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: #0E1726;
}
.rev-login-header .subtitle {
  font-size: 13.5px;
  color: #6B7280;
  margin: 0;
  line-height: 1.5;
}
.rev-login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: #9CA3AF;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rev-login-divider::before,
.rev-login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E5E7EB;
}
.rev-login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: #6B7280;
  line-height: 1.6;
  padding: 0 12px;
}
.rev-login-footer a {
  color: #0F766E;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .rev-login-card { padding: 28px 22px; }
  .rev-login-header h1 { font-size: 19px; }
}

/* ============================================================
   Topbar — área do usuário logado
   ============================================================ */
.rev-topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rev-topbar-user-info {
  text-align: right;
  line-height: 1.3;
}
.rev-topbar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #0E1726;
}
.rev-topbar-user-org {
  font-size: 11px;
  color: #6B7280;
}
.rev-topbar-logout {
  background: transparent;
  border: 1px solid #E5E7EB;
  color: #6B7280;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.rev-topbar-logout:hover {
  background: #FEE2E2;
  border-color: #FECACA;
  color: #991B1B;
}

@media (max-width: 600px) {
  .rev-topbar-user-info { display: none; }
}

/* ============================================================
   Stepper de progresso (fluxo da aplicação)
   ============================================================ */
.rev-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 28px 0 12px;
  position: relative;
}
.rev-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 0;
}
.rev-step-bubble {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #F3F4F6;
  border: 2px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 2;
  transition: all .25s;
  flex-shrink: 0;
}
.rev-step-label {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  line-height: 1.3;
  padding: 0 4px;
}
.rev-step-sub {
  font-size: 10.5px;
  color: #9CA3AF;
  margin-top: 2px;
  line-height: 1.2;
}
.rev-step-connector {
  position: absolute;
  top: 19px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: #E5E7EB;
  z-index: 1;
}
.rev-step:last-child .rev-step-connector { display: none; }

.rev-step.is-done .rev-step-bubble {
  background: #0F766E;
  border-color: #0F766E;
  color: white;
}
.rev-step.is-done .rev-step-bubble::after {
  content: '✓';
  font-size: 16px;
}
.rev-step.is-done .rev-step-bubble-inner { display: none; }
.rev-step.is-done .rev-step-label { color: #0F766E; }
.rev-step.is-done .rev-step-connector { background: #0F766E; }

.rev-step.is-current .rev-step-bubble {
  background: white;
  border-color: #0F766E;
  color: #0F766E;
  box-shadow: none;
  animation: stepPulse 2s infinite;
}
.rev-step.is-current .rev-step-label {
  color: #0F766E;
  font-weight: 700;
}
@keyframes stepPulse {
  0%, 100% { box-shadow: none; }
  50%      { box-shadow: none; }
}

.rev-step.is-rejected .rev-step-bubble {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #991B1B;
}
.rev-step.is-rejected .rev-step-bubble::after { content: '✕'; font-size: 16px; }
.rev-step.is-rejected .rev-step-bubble-inner { display: none; }
.rev-step.is-rejected .rev-step-label { color: #991B1B; }

@media (max-width: 700px) {
  .rev-stepper { flex-wrap: wrap; gap: 10px; }
  .rev-step-connector { display: none; }
  .rev-step { flex: 0 0 calc(33% - 10px); }
  .rev-step-label { font-size: 11px; }
}

/* ============================================================
   Botão de upload customizado (esconde input feio)
   ============================================================ */
.rev-upload {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.rev-upload-input {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.rev-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border: 1.5px dashed #0F766E;
  border-radius: 8px;
  color: #0F766E;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.rev-upload-btn:hover {
  background: #ECFDF8;
  border-style: solid;
}
.rev-upload-input:focus + .rev-upload-btn {
  outline: none;
  box-shadow: none;
}
.rev-upload-filename {
  font-size: 12px;
  color: #374151;
  font-weight: 500;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rev-upload-filename:empty { display: none; }
.rev-upload-submit {
  padding: 8px 14px;
  background: #0F766E;
  color: white;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.rev-upload-submit:hover { background: #115E59; }
.rev-upload-submit:disabled { background: #9CA3AF; cursor: not-allowed; }
