:root {
  --primary-blue: #373778;
  --primary-gold: #b48b34;
  --secondary-gold: #bc891d;
  --success-green: #28a745;
  --error-red: #dc3545;
  --neutral-white: #ffffff;
  --neutral-light: #f8f9fa;
  --neutral-medium: #6c757d;
  --gradient-primary: linear-gradient(135deg, #373778 0%, #b48b34 100%);
  --gradient-gold: linear-gradient(90deg, #b48b34 0%, #bc891d 100%);
  --shadow-subtle: 0 4px 20px rgba(55, 55, 120, 0.08);
  --shadow-medium: 0 8px 30px rgba(55, 55, 120, 0.12);
  --shadow-strong: 0 25px 50px rgba(55, 55, 120, 0.15);
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 8px;
}

* {
  box-sizing: border-box;
  text-decoration: none;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

body {
  font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica,
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.42857143;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px 16px 0 16px;
  background: var(--gradient-primary);
  overflow-y: auto;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  z-index: 1;
  pointer-events: none;
}

/* HEADER - Seguindo padrão do login */
.header {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 10;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.header-logo {
  width: 50px;
  height: 50px;
  transition: var(--transition);
  flex-shrink: 0;
}

.header-title {
  font-size: clamp(14px, 2.5vw, 22px);
  font-weight: 600;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: var(--neutral-white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

.header-subtitle {
  color: var(--primary-gold);
  font-weight: 500;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.header-logo:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.header-decoration {
  width: 80px;
  height: 4px;
  background: var(--gradient-gold);
  border-radius: 2px;
  opacity: 0.7;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scaleX(1);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.1);
  }
}

/* MAIN CONTAINER - Centralização perfeita como no login */
.main-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  width: 100%;
  min-height: 0;
}

/* CARD PRINCIPAL - Seguindo exatamente o padrão do login */
.selection-card {
  background: var(--neutral-white);
  width: 100%;
  max-width: 500px;
  color: var(--primary-blue);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 32px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
  position: relative;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.6s ease-out;
  margin: auto;
}

.selection-card:hover {
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* LOGO - Mesmo estilo do login */
.brand-logo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  margin-bottom: 20px;
  transition: var(--transition);
}

.brand-logo:hover {
  transform: scale(1.02);
}

/* TÍTULOS - Seguindo padrão do login */
.selection-title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 500;
  margin-bottom: 8px;
  text-align: center;
  color: var(--primary-blue);
}

.selection-subtitle {
  text-align: center;
  color: var(--neutral-medium);
  font-size: clamp(14px, 2.5vw, 16px);
  margin-bottom: 32px;
  font-weight: 400;
}

/* CONTAINER DAS EMPRESAS */
.companies-container {
  width: 100%;
  max-width: 350px;
  margin-bottom: 24px;
}

/* OPÇÕES DE EMPRESA - Reformuladas */
.company-option {
  position: relative;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideInUp 0.6s ease-out forwards;
}

.company-option:nth-child(1) {
  animation-delay: 0.2s;
}
.company-option:nth-child(2) {
  animation-delay: 0.3s;
}
.company-option:nth-child(3) {
  animation-delay: 0.4s;
}

.company-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.company-label {
  display: block;
  background: var(--neutral-light);
  border: 1px solid #eaeaea;
  border-radius: var(--border-radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  font-weight: 500;
  color: var(--primary-blue);
  font-size: 14px;
  width: 100%;
  text-align: left;
}

/* HOVER EFFECT */
.company-label:hover {
  border-color: var(--primary-gold);
  background: rgba(180, 139, 52, 0.02);
  transform: translateY(-1px);
  box-shadow: var(--shadow-subtle);
}

/* ESTADO SELECIONADO */
.company-input:checked + .company-label {
  background: var(--gradient-primary);
  color: var(--neutral-white);
  border-color: var(--primary-gold);
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

/* INDICADOR VISUAL */
.company-label::before {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid var(--neutral-medium);
  border-radius: 50%;
  transition: var(--transition);
}

.company-input:checked + .company-label::before {
  background: var(--neutral-white);
  border-color: var(--neutral-white);
  box-shadow: inset 0 0 0 3px var(--primary-blue);
}

/* BOTÃO ENTRAR - Seguindo padrão do login */
.enter-button {
  width: 100%;
  max-width: 350px;
  padding: 16px;
  background: var(--gradient-gold);
  color: var(--neutral-white);
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin: 20px 0;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.enter-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(180, 139, 52, 0.3);
}

.enter-button:active {
  transform: translateY(0);
}

.enter-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ESTADO DE LOADING */
.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--neutral-white);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* LINK VOLTAR - Seguindo padrão do login */
.back-link {
  color: var(--primary-gold);
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  margin-top: 12px;
}

.back-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--secondary-gold);
  transition: var(--transition);
}

.back-link:hover {
  color: var(--secondary-gold);
}

.back-link:hover::after {
  width: 100%;
}

/* FOOTER - Corrigido para sempre ficar no final */
.footer {
  width: calc(100% + 32px);
  margin-left: -16px;
  margin-right: -16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 13px;
  color: var(--neutral-white);
  padding: 16px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
  position: static;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  font-size: 13px;
}

.footer-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary-gold);
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary-gold);
}

.footer-link:hover::after {
  width: 100%;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

/* ANIMAÇÕES */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVIDADE TOTAL - Seguindo padrão do login */

/* Extra Large Desktop */
@media screen and (min-width: 1440px) {
  .selection-card {
    max-width: 520px;
    padding: 50px 40px;
  }
  
  .brand-logo {
    width: 140px;
    height: 140px;
  }
  
  .header-logo {
    width: 55px;
    height: 55px;
  }
}

/* Large Desktop */
@media screen and (min-width: 1200px) and (max-width: 1439px) {
  .selection-card {
    max-width: 480px;
    padding: 45px 35px;
  }
}

/* Desktop */
@media screen and (min-width: 992px) and (max-width: 1199px) {
  .selection-card {
    max-width: 460px;
    padding: 40px 32px;
  }
}

/* iPad Pro / Large Tablet */
@media screen and (min-width: 768px) and (max-width: 991px) {
  body {
    padding: 20px 20px 0 20px;
  }
  
  .footer {
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
  }
  
  .selection-card {
    max-width: 450px;
    padding: 35px 30px;
    margin: auto;
  }
  
  .brand-logo {
    width: 100px;
    height: 100px;
  }
  
  .header-logo {
    width: 45px;
    height: 45px;
  }
  
  .header-decoration {
    width: 60px;
    height: 3px;
  }
}

/* iPad / Tablet */
@media screen and (min-width: 481px) and (max-width: 767px) {
  body {
    padding: 16px 16px 0 16px;
  }
  
  .footer {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
  }
  
  .header {
    gap: 12px;
    margin-bottom: 16px;
  }
  
  .header-logo {
    width: 45px;
    height: 45px;
  }
  
  .header-decoration {
    width: 60px;
    height: 3px;
  }
  
  .selection-card {
    max-width: 400px;
    padding: 30px 25px;
    border-radius: 20px;
    margin: auto;
  }
  
  .brand-logo {
    width: 90px;
    height: 90px;
    margin-bottom: 16px;
  }
  
  .selection-title {
    font-size: clamp(16px, 2.8vw, 20px);
    margin-bottom: 6px;
  }
  
  .selection-subtitle {
    font-size: clamp(14px, 2.2vw, 15px);
    margin-bottom: 24px;
  }
  
  .companies-container {
    max-width: 100%;
  }
  
  .company-label {
    padding: 14px 18px;
    font-size: 14px;
  }
  
  .enter-button {
    padding: 14px;
    font-size: 15px;
  }
}

/* Large Mobile */
@media screen and (min-width: 376px) and (max-width: 480px) {
  body {
    padding: 14px 14px 0 14px;
  }
  
  .footer {
    width: calc(100% + 28px);
    margin-left: -14px;
    margin-right: -14px;
  }
  
  .header {
    gap: 10px;
    margin-bottom: 14px;
  }
  
  .header-logo {
    width: 40px;
    height: 40px;
  }
  
  .header-decoration {
    width: 50px;
    height: 3px;
  }
  
  .selection-card {
    max-width: 100%;
    padding: 25px 20px;
    border-radius: 18px;
    margin: auto;
  }
  
  .brand-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 14px;
  }
  
  .selection-title {
    font-size: 16px;
    margin-bottom: 4px;
  }
  
  .selection-subtitle {
    font-size: 14px;
    margin-bottom: 20px;
  }
  
  .company-label {
    padding: 13px 16px;
    font-size: 14px;
  }
  
  .company-label::before {
    width: 16px;
    height: 16px;
    right: 14px;
  }
  
  .enter-button {
    padding: 13px;
    font-size: 14px;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .footer-links {
    justify-content: center;
    gap: 12px;
  }
}

/* Small Mobile */
@media screen and (max-width: 375px) {
  body {
    padding: 12px 12px 0 12px;
  }
  
  .footer {
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
  }
  
  .header {
    gap: 8px;
    margin-bottom: 12px;
  }
  
  .header-logo {
    width: 35px;
    height: 35px;
  }
  
  .header-decoration {
    width: 40px;
    height: 2px;
  }
  
  .selection-card {
    max-width: 100%;
    padding: 20px 16px;
    border-radius: 16px;
    margin: auto;
  }
  
  .brand-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 12px;
  }
  
  .selection-title {
    font-size: 14px;
    margin-bottom: 3px;
  }
  
  .selection-subtitle {
    font-size: 12px;
    margin-bottom: 18px;
  }
  
  .company-label {
    padding: 12px 14px;
    font-size: 13px;
  }
  
  .company-label::before {
    width: 14px;
    height: 14px;
    right: 12px;
  }
  
  .enter-button {
    padding: 12px;
    font-size: 13px;
  }
  
  .back-link {
    font-size: 12px;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 6px;
  }
  
  .footer-link {
    font-size: 11px;
  }
  
  .footer-copyright {
    font-size: 10px;
  }
}

/* Extra Small Mobile */
@media screen and (max-width: 320px) {
  body {
    padding: 10px 10px 0 10px;
  }
  
  .footer {
    width: calc(100% + 20px);
    margin-left: -10px;
    margin-right: -10px;
  }
  
  .selection-card {
    padding: 18px 14px;
    border-radius: 14px;
  }
  
  .brand-logo {
    width: 60px;
    height: 60px;
  }
  
  .selection-title {
    font-size: 13px;
  }
  
  .selection-subtitle {
    font-size: 11px;
  }
  
  .company-label {
    padding: 11px 12px;
    font-size: 12px;
  }
  
  .enter-button {
    padding: 11px;
    font-size: 12px;
  }
}

/* Altura da tela */
@media screen and (max-height: 600px) {
  .selection-card {
    padding: 20px;
    margin: 10px auto;
  }
  
  .brand-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
  }
  
  .selection-title {
    margin-bottom: 4px;
  }
  
  .selection-subtitle {
    margin-bottom: 16px;
  }
}

/* Modo paisagem em dispositivos móveis */
@media screen and (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 8px;
  }
  
  .header {
    margin-bottom: 8px;
  }
  
  .selection-card {
    padding: 16px;
    margin: 8px auto;
  }
  
  .brand-logo {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
  }
  
  .selection-title {
    font-size: 14px;
    margin-bottom: 2px;
  }
  
  .selection-subtitle {
    font-size: 12px;
    margin-bottom: 12px;
  }
  
  .company-option {
    margin-bottom: 8px;
  }
  
  .company-label {
    padding: 10px 12px;
  }
}

/* Ajustes para foco de acessibilidade */
.company-label:focus,
.enter-button:focus,
.back-link:focus {
  outline: 2px solid var(--primary-gold);
  outline-offset: 2px;
}

/* Melhorias para animações reduzidas */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}