/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #d22630 0%, #393939 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Logo Styles */
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.company-logo {
  max-width: 275px;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
}

h1 {
  color: #393939;
  margin-bottom: 10px;
  font-size: 28px;
}

.subtitle {
  color: #718096;
  margin-bottom: 30px;
  font-size: 16px;
}

/* Alert Messages */
#alert-container {
  margin-bottom: 20px;
}

.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  font-size: 14px;
  animation: slideDown 0.3s ease-out;
}

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

.alert-success {
  background-color: #c6f6d5;
  color: #22543d;
  border-left: 4px solid #38a169;
}

.alert-error {
  background-color: #fed7d7;
  color: #742a2a;
  border-left: 4px solid #e53e3e;
}

.alert-info {
  background-color: #bee3f8;
  color: #2c5282;
  border-left: 4px solid #3182ce;
}

/* Form Styles */
fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
}

legend {
  font-weight: 600;
  color: #2d3748;
  font-size: 18px;
  padding: 0 10px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  flex: 1 1 100%;
}

label {
  font-weight: 500;
  margin-bottom: 8px;
  color: #4a5568;
  font-size: 14px;
}

.required {
  color: #e53e3e;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  padding: 12px 15px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #d22630;
  box-shadow: 0 0 0 3px rgba(210, 38, 48, 0.1);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Worldline Custom Checkout Fields */
.worldline-field {
  padding: 12px 15px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: white;
  min-height: 44px;
  transition: all 0.2s;
}

.worldline-field:hover {
  border-color: #a0aec0;
}

.worldline-field.focused {
  border-color: #d22630;
  box-shadow: 0 0 0 3px rgba(210, 38, 48, 0.1);
}

.worldline-field.error {
  border-color: #e53e3e;
}

.worldline-field.complete {
  border-color: #38a169;
}

.field-error {
  color: #e53e3e;
  font-size: 12px;
  margin-top: 5px;
  min-height: 18px;
}

.help-text {
  font-size: 12px;
  color: #718096;
  margin-top: 5px;
}

.help-text a {
  color: #d22630;
  text-decoration: none;
}

.help-text a:hover {
  text-decoration: underline;
}

/* Card Types */
.card-types {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-types small {
  color: #718096;
}

.card-icons {
  display: flex;
  gap: 8px;
}

.card-icon {
  padding: 4px 8px;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #4a5568;
}

/* Card Brand Display */
.card-number-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #edf2f7;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #2d3748;
}

.card-brand span:first-child {
  font-size: 14px;
}

/* Form Actions */
.form-actions {
  margin-top: 30px;
  text-align: center;
}

.btn-primary {
  background: #d22630;
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 250px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(210, 38, 48, 0.3);
  background: #b91f25;
}

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

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

.btn-spinner {
  display: inline-block;
}

.disclaimer {
  text-align: center;
  margin-top: 20px;
  color: #718096;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: slideUp 0.3s;
}

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

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #a0aec0;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: #2d3748;
}

.modal-content h3 {
  margin-bottom: 15px;
  color: #2d3748;
}

.modal-content p {
  margin-bottom: 10px;
  color: #4a5568;
}

.modal-content ul {
  margin-left: 20px;
  color: #4a5568;
}

.modal-content li {
  margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 25px 20px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  h1 {
    font-size: 24px;
  }

  .btn-primary {
    width: 100%;
    min-width: unset;
  }

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

  fieldset {
    padding: 20px 15px;
  }

  .card-types {
    flex-wrap: wrap;
  }

  .card-icons {
    flex-wrap: wrap;
  }

  .card-number-label {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-brand {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 20px 15px;
  }

  fieldset {
    padding: 15px 10px;
  }

  legend {
    font-size: 16px;
  }

  .card-icon {
    font-size: 10px;
    padding: 3px 6px;
  }
}

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
}
