/* === RESET E VARIÁVEIS === */
:root {
  --primary-color: #f37335;
  --secondary-color: #f5af19;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --text-color: #333;
  --text-muted: #666;
  --bg-light: #103661;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.18);
  --border-radius: 0.75rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  background: var(--bg-light);
}

/* === LAYOUT PRINCIPAL === */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.split-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === OVERLAY DE LOADING === */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-text {
  color: white;
  font-size: 1rem;
  font-weight: 600;
}

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

  100% {
    transform: rotate(360deg);
  }
}

/* === PAINEL ESQUERDO === */
.left-panel {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 35vh;
  position: relative;
  overflow: hidden;
}

.left-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  opacity: 0.95;
  z-index: 0;
}

.left-content {
  position: relative;
  z-index: 1;
  max-width: 350px;
  width: 100%;
}

/* === LOGO AUMENTADA === */
.logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 2rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.logo:hover {
  transform: scale(1.05);
}

/* === LOGO DO PAINEL DIREITO (NOVA) === */
.logo-crefaz {
  max-width: 150px;
  height: auto;
  display: block;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

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

.hero-image {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--secondary-color);
  margin: 0 auto 1.5rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  animation: pulse 10s infinite;
}

.hero-image:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
  box-shadow: 0 0 0 8px rgba(245, 175, 25, 0.15);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tagline h4 {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  line-height: 1.3;
}

.tagline p {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 500;
  margin-bottom: 2rem;
}

/* === STEPPER COM ÍCONES MAIORES === */
.stepper {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  width: 100%;
  max-width: 320px;
  display: none;
}

.step {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.step::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 40px;
  bottom: -12px;
  width: 3px;
  background: rgba(255, 255, 255, 0.3);
  z-index: -1;
}

.step:last-child::after {
  display: none;
}

/* === ÍCONES DO STEPPER MAIORES === */
.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  transition: var(--transition);
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.step-icon.completed {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.5);
  border-color: white;
  transform: scale(1.05);
}

.step-icon.active {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4);
  border-color: white;
  animation: iconPulse 2s infinite;
  transform: scale(1.1);
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4);
  }

  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.2);
  }
}

.step-content {
  flex: 1;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.8;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.step-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0.1rem;
  line-height: 1.2;
}

.secure-message {
  font-size: 0.85rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.8rem 1.2rem;
  border-radius: 25px;
  backdrop-filter: blur(10px);
  margin-top: 1rem;
}

.secure-message i {
  font-size: 1rem;
}

/* === PAINEL DIREITO === */
.right-panel {
  background: var(--bg-light);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 65vh;
}

/* === CARDS ULTRA COMPACTOS COM LARGURA MAIOR === */
.form-card,
.message-card {
  width: 100%;
  max-width: 550px;
  background: white;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border-bottom: 3px solid var(--primary-color);
  position: relative;
  transition: var(--transition);
  margin: 0 auto;
}

.message-card {
  border-bottom-color: var(--success-color);
  text-align: center;
  max-width: 520px;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.4rem;
  text-align: center;
  line-height: 1;
}

.success-icon {
  font-size: 3.5rem;
  color: var(--success-color);
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

/* === FORMULÁRIOS EXTREMAMENTE COMPACTOS === */
.form-group {
  margin-bottom: 0.3rem;
}

.form-label {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.1rem;
  font-size: 0.7rem;
  display: block;
}

.form-control {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid #e9ecef;
  border-radius: 0.25rem;
  transition: var(--transition);
  background: white;
  line-height: 1.1;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.15rem rgba(243, 115, 53, 0.15);
  outline: none;
}

.form-control.is-valid {
  border-color: var(--success-color);
}

.form-control.is-invalid {
  border-color: var(--danger-color);
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.05rem;
  font-size: 0.6rem;
  color: var(--danger-color);
  
  line-height: 1;
}

.form-check {
  margin: 0.3rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
}

.form-check-input {
  width: 10px;
  height: 10px;
  margin-top: 0.05rem;
  border: 1px solid var(--primary-color);
  flex-shrink: 0;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-label {
  font-size: 0.65rem;
  line-height: 1.1;
  color: var(--text-muted);
}

.form-check-label a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

.form-check-label a:hover {
  text-decoration: underline;
}

/* === BOTÕES EXTREMAMENTE COMPACTOS === */
.btn-custom {
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  border-radius: 0.25rem;
  border: none;
  transition: var(--transition);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 28px;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #e06a2e;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(243, 115, 53, 0.3);
  color: white;
}

.btn-outline {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
  color: white;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* === LOADING STATES === */
.btn.loading {
  color: transparent;
  position: relative;
}

.btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.form-control.loading {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3e%3cpath fill='%23f37335' d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z'/%3e%3cpath fill='%23f37335' d='M12 6a6 6 0 0 0-6 6h2a4 4 0 0 1 4-4z'%3e%3canimateTransform attributeName='transform' type='rotate' dur='1s' repeatCount='indefinite' values='0 12 12;360 12 12'/%3e%3c/path%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}

/* === INFO BOXES === */
.info-box {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1.2rem 0;
  text-align: left;
}

.info-title {
  font-weight: 700;
  color: var(--text-color);
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-content {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.highlight-message {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

/* === ALERTAS === */
.alert-container {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 10000;
  max-width: 350px;
}

.alert-custom {
  background: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-left: 4px solid;
  animation: slideInRight 0.5s ease-out;
  font-size: 0.85rem;
}

.alert-success {
  border-left-color: var(--success-color);
  color: #155724;
}

.alert-danger {
  border-left-color: var(--danger-color);
  color: #721c24;
}

.alert-warning {
  border-left-color: var(--warning-color);
  color: #be9003;
}

.alert-info {
  border-left-color: #17a2b8;
  color: #0c5460;
}

/* === PÁGINAS === */
.page {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: var(--transition);
}

.page.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* === ANIMAÇÕES === */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* === RESPONSIVO === */

/* Mobile Small (até 575px) */
@media (max-width: 575.98px) {
  .left-panel {
    padding: 1rem;
    min-height: 30vh;
  }

  .logo {
    max-width: 140px;
    margin-bottom: 1.5rem;
  }

  .logo-crefaz {
    max-width: 120px;
    margin-bottom: 1rem;
  }

  .hero-image {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
  }

  .tagline h4 {
    font-size: 1rem;
  }

  .tagline p {
    font-size: 0.85rem;
  }

  .right-panel {
    padding: 1rem;
    min-height: 70vh;
  }

  .form-card,
  .message-card {
    padding: 1.1rem;
    margin: 0;
    max-width: none;
  }

  .card-title {
    font-size: 0.95rem;
    margin-bottom: 1.1rem;
  }

  .form-control {
    font-size: 16px;
    padding: 0.7rem;
  }

  .btn-custom {
    padding: 0.75rem 1.1rem;
    font-size: 0.8rem;
    min-height: 42px;
  }

  .alert-container {
    left: 10px;
    right: 10px;
    max-width: none;
    top: 10px;
  }

  .success-icon {
    font-size: 3rem;
  }

  .secure-message {
    font-size: 0.75rem;
    padding: 0.6rem 0.8rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }
}

/* Mobile Large (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .left-panel {
    padding: 1.2rem;
    min-height: 32vh;
  }

  .logo {
    max-width: 160px;
  }

  .logo-crefaz {
    max-width: 140px;
  }

  .hero-image {
    width: 120px;
    height: 120px;
  }

  .right-panel {
    padding: 1.5rem;
    min-height: 68vh;
  }

  .form-card,
  .message-card {
    padding: 0.8rem;
    max-width: 500px;
  }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .split-layout {
    flex-direction: row;
    height: 100vh;
  }

  .left-panel {
    flex: 0 0 40%;
    min-height: 100vh;
    padding: 2rem;
  }

  .stepper {
    display: block;
  }

  .logo {
    max-width: 300px;
  }

  .logo-crefaz {
    max-width: 160px;
  }

  .hero-image {
    width: 160px;
    height: 160px;
  }

  .right-panel {
    flex: 1;
    padding: 2rem;
    min-height: auto;
  }

  .form-card,
  .message-card {
    max-width: 520px;
    padding: 1rem;
  }

  .card-title {
    font-size: 0.9rem;
  }
}

/* Desktop (992px+) */
@media (min-width: 992px) {
  .split-layout {
    flex-direction: row;
    height: 100vh;
  }

  .left-panel {
    flex: 0 0 42%;
    min-height: 100vh;
    padding: 2.5rem;
  }

  .stepper {
    display: block;
  }

  .logo {
    max-width: 220px;
  }

  .logo-crefaz {
    max-width: 180px;
  }

  .hero-image {
    width: 180px;
    height: 180px;
  }

  .tagline h4 {
    font-size: 1.3rem;
  }

  .tagline p {
    font-size: 1.1rem;
  }

  .right-panel {
    flex: 1;
    padding: 2.5rem;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .form-card,
  .message-card {
    max-width: 550px;
    padding: 1.2rem;
  }

  .card-title {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
  }

  .success-icon {
    font-size: 3rem;
  }

  .form-control {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .btn-custom {
    padding: 0.6rem 1.2rem;
    font-size: 0.75rem;
    min-height: 36px;
  }

  .form-group {
    margin-bottom: 0.6rem;
  }

  .form-label {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
  }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
  .left-panel {
    flex: 0 0 38%;
    padding: 3rem;
  }

  .logo {
    max-width: 240px;
  }

  .logo-crefaz {
    max-width: 200px;
  }

  .form-card,
  .message-card {
    max-width: 580px;
    padding: 1.3rem;
  }

  .card-title {
    font-size: 1rem;
    margin-bottom: 0.9rem;
  }
}

/* Extra Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .form-card,
  .message-card {
    max-width: 600px;
  }
}

/* Hover effects only on non-touch devices */
@media (hover: hover) {
  .form-card:hover,
  .message-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
  }

  .btn-custom:hover {
    transform: translateY(-2px);
  }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 767.98px) {
  body {
    overflow-x: hidden;
  }
}

/* Grid responsivo */
.form-row {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.3rem;
}

.form-row .form-group {
  margin-bottom: 0;
  flex: 1;
}

.form-row .form-group.col-narrow {
  flex: 0 0 30%;
}

.form-row .form-group.col-wide {
  flex: 1;
}

@media (max-width: 575.98px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group {
    margin-bottom: 1rem;
    flex: none;
  }
}

.w-100 {
  width: 100% !important;
}

.d-flex {
  display: flex !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.justify-content-center {
  justify-content: center !important;
}

.me-2 {
  margin-right: 0.5rem !important;
}

.ms-2 {
  margin-left: 0.5rem !important;
}

.flex-grow-1 {
  flex-grow: 1 !important;
}

.align-items-center {
  align-items: center !important;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: inherit;
}

.text-center {
  text-align: center !important;
}

.py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.mt-5 {
  margin-top: 3rem !important;
}

.border-top {
  border-top: 1px solid #dee2e6 !important;
}

.mx-2 {
  margin-left: 0.5rem !important;
  margin-right: 0.5rem !important;
}
