:root {
  --primary: #0066CC;
  --primary-dark: #004C99;
  --primary-orange: #0099FF;
  --primary-light: #E8F4FF;
  --primary-border: #99CCFF;
  --gradient: linear-gradient(135deg, #0066CC 0%, #0099FF 100%);
  --white: #ffffff;
  --gray-light: #f4f6f9;
  --gray: #8a9ab5;
  --dark: #1e2d3d;
  --shadow: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 16px;
}

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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0066CC 0%, #0099FF 60%, #1e2d3d 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 440px;
}

/* Card principal */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Header do card */
.card-header {
  background: linear-gradient(135deg, #071535 0%, #0d2356 60%, #0a1b44 100%);
  padding: 32px 24px 24px;
  text-align: center;
  position: relative;
}

.card-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--white);
  border-radius: 50% 50% 0 0 / 20px 20px 0 0;
}

.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: auto;
  width: 230px;
  max-width: 88%;
  object-fit: contain;
  border-radius: 24px;
  animation: pulse 2s infinite;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: white;
  letter-spacing: 1px;
}

.logo-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 400;
}

/* Wifi icon */
.wifi-icon {
  font-size: 56px;
  margin-bottom: 8px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

/* Card body */
.card-body {
  padding: 36px 28px 28px;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
  text-align: center;
}

.card-subtitle {
  font-size: 14px;
  color: var(--gray);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8ecf0;
  border-radius: 10px;
  font-size: 16px;
  color: var(--dark);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: var(--gray-light);
}

.form-control:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}

.form-control.error {
  border-color: var(--red);
}

/* Phone input com bandeira */
.phone-wrapper {
  display: flex;
  align-items: center;
  background: var(--gray-light);
  border: 2px solid #e8ecf0;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.phone-wrapper:focus-within {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}

.phone-prefix {
  padding: 14px 12px;
  font-size: 16px;
  color: var(--gray);
  border-right: 2px solid #e8ecf0;
  white-space: nowrap;
  background: inherit;
  user-select: none;
}

.phone-wrapper input {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--dark);
  outline: none;
}

/* OTP input */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0;
}

.otp-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #e8ecf0;
  border-radius: 12px;
  background: var(--gray-light);
  color: var(--dark);
  outline: none;
  transition: all 0.2s;
}

.otp-input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
  transform: scale(1.05);
}

.otp-input.filled {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Botões */
.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(0,102,204,0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,102,204,0.45);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.btn-outline:hover {
  background: var(--primary-light);
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Alert messages */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-success {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary-border);
}

.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Footer */
.card-footer {
  padding: 16px 28px 24px;
  text-align: center;
  border-top: 1px solid #f0f3f7;
}

.footer-text {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.6;
}

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

/* Resend timer */
.resend-timer {
  text-align: center;
  font-size: 13px;
  color: var(--gray);
  margin-top: 12px;
}

.resend-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.resend-btn:disabled {
  color: var(--gray);
  cursor: not-allowed;
  text-decoration: none;
}

/* Success page */
.success-icon {
  font-size: 72px;
  text-align: center;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.access-info {
  background: var(--primary-light);
  border: 2px solid var(--primary-border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin: 20px 0;
}

.access-info .time-badge {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary-dark);
  display: block;
}

.access-info .time-label {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}

.credentials {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  text-align: left;
}

.credentials h4 {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cred-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #e8ecf0;
  font-size: 14px;
}

.cred-row:last-child { border-bottom: none; }
.cred-label { color: var(--gray); }
.cred-value { font-weight: 700; color: var(--dark); font-family: monospace; }

/* Steps indicator */
.steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8ecf0;
  transition: all 0.3s;
}

.step-dot.active {
  background: var(--primary);
  transform: scale(1.4);
}

.step-dot.done {
  background: var(--primary);
}

/* Hidden */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 480px) {
  .card-body { padding: 28px 20px 20px; }
  .otp-input { width: 44px; height: 52px; font-size: 20px; }
}

/* Desktop: card um pouco maior */
@media (min-width: 600px) {
  .container { max-width: 480px; }
  .brand-logo { height: 110px; width: 110px; }
}

@media (min-width: 900px) {
  .container { max-width: 500px; }
  .card-body { padding: 40px 36px 32px; }
}
