:root {
  --primary-color: #0056b3;
  --primary-dark: #003d7a;
  --primary-light: #e6f0ff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --error-color: #dc3545;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

body {
  background-color: #f8f9fa;
  color: #212529;
  line-height: 1.6;
  min-height: 100vh;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  color: white;
  padding: 1rem 2rem;
  box-shadow: var(--box-shadow);
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-right: 120px;
}

.logo-icon {
  font-size: 2.5rem;
  color: white;
}

.logo-text h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.logo-text p {
  font-size: 0.875rem;
  opacity: 0.9;
}

.go-back-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: absolute;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  text-decoration: none;
}

.go-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-50%) scale(1.05);
}

.go-back-btn:active {
  transform: translateY(-50%) scale(0.98);
}

.app-content {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.form-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  max-width: 600px;
  margin: 0 auto;
  transform: translateY(0);
  transition: var(--transition);
}

.form-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
  background: var(--primary-color);
  color: white;
  padding: 1.25rem 1.5rem;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
  animation: fadeIn 0.5s ease-out;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  min-height: 48px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

.form-group input.error {
  border-color: var(--error-color);
  background-color: rgba(220, 53, 69, 0.05);
}

.mobile-input-container {
  display: flex;
  align-items: center;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.country-code {
  padding: 0 1rem;
  background: #f8f9fa;
  color: #6c757d;
  border-right: 1px solid #ced4da;
  height: 48px;
  display: flex;
  align-items: center;
}

#mobile-input {
  border: none;
  border-radius: 0;
  flex: 1;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230056b3'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.5rem;
  padding-right: 3rem !important;
}

input[type="date"] {
  min-height: 48px;
}

.form-actions {
  margin-top: 2rem;
}

.primary-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 48px;
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.primary-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.touch-active {
  transform: scale(0.98) !important;
  opacity: 0.9 !important;
}

.code-display {
  background: #f8f9fa;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
  border: 1px solid #e0e0e0;
}

.code-header {
  font-size: 1rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.code-value {
  font-size: 1.5rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  color: var(--primary-dark);
  background: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.code-value::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 86, 179, 0.1), transparent);
  animation: shine 1.5s infinite;
}

.code-explanation {
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-top: 1rem;
  line-height: 1.5;
}

.copy-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  margin-top: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

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

.error-message {
  background: var(--error-color);
  color: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeIn 0.5s ease-out;
}

.error-message i {
  font-size: 1.25rem;
}

.hidden {
  display: none;
}

.app-footer {
  background: #343a40;
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 0.875rem;
}

.autocomplete {
  position: relative;
  display: inline-block;
  width: 100%;
}

.autocomplete-items {
  position: absolute;
  border: 1px solid #d4d4d4;
  border-bottom: none;
  border-top: none;
  z-index: 99;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: white;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.autocomplete-items div {
  padding: 10px;
  cursor: pointer;
  background-color: #fff;
  border-bottom: 1px solid #d4d4d4;
}

.autocomplete-items div:hover {
  background-color: var(--primary-light);
}

.autocomplete-active {
  background-color: var(--primary-color) !important;
  color: white;
}

.modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  width: 90%;
  max-width: 500px;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.modal-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-header h3 {
  font-size: 1.25rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.modal-body {
  margin-bottom: 1.5rem;
}

.modal-body p {
  margin-bottom: 1rem;
  text-align: center;
}

.modal-footer {
  display: flex;
  justify-content: center;
}

.whatsapp-btn {
  background: #25D366;
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  margin-top: 1rem;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.whatsapp-btn:hover {
  background: #128C7E;
  transform: translateY(-2px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shine {
  100% {
    left: 100%;
  }
}

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

.fa-spinner {
  animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
  html {
    -webkit-overflow-scrolling: touch;
  }
  
  .app-header {
    padding: 1rem;
  }
  
  .logo-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-right: 0;
  }
  
  .go-back-btn {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
  }
  
  .app-content {
    padding: 1rem;
  }
  
  .form-body {
    padding: 1rem;
  }

  .code-value {
    font-size: 1.2rem;
    padding: 0.75rem;
  }
  
  input, select, textarea {
    font-size: 16px !important;
  }
  
  .autocomplete-items {
    max-height: 150px;
  }
}

@media (max-width: 480px) {
  .logo-text h1 {
    font-size: 1.25rem;
  }
  
  .logo-text p {
    font-size: 0.75rem;
  }
  
  .card-header h2 {
    font-size: 1.1rem;
  }
  
  .form-group input,
  .form-group select {
    padding: 0.625rem 0.875rem;
  }
  
  .primary-btn {
    padding: 0.75rem 1rem;
  }

  .code-value {
    font-size: 1rem;
    padding: 0.5rem;
    word-break: break-all;
  }
  
  .autocomplete-items {
    max-height: 120px;
  }
  
  .go-back-btn {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }
}