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

:root {
  --primary-color: #667eea;
  --primary-dark: #5568d3;
  --secondary-color: #764ba2;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
}

/* ==================== NOTIFICATION SYSTEM ==================== */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

.notification {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideInRight 0.3s ease-out;
  border-left: 4px solid;
  min-width: 320px;
  max-width: 420px;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.notification.removing {
  animation: slideOutRight 0.3s ease-out forwards;
}

.notification.success {
  border-left-color: var(--success-color);
}

.notification.error {
  border-left-color: var(--error-color);
}

.notification.warning {
  border-left-color: var(--warning-color);
}

.notification-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.notification.success .notification-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.notification.error .notification-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
}

.notification.warning .notification-icon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-dark);
}

.notification-message {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.4;
}

.notification-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.notification-close:hover {
  color: var(--text-dark);
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

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

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==================== REFERRAL MODAL ==================== */
.referral-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.referral-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--text-light);
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-dark);
}

.modal-body {
  color: var(--text-light);
  line-height: 1.6;
}

.modal-body ul {
  margin: 16px 0;
  padding-left: 20px;
}

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

.code-example {
  background: var(--bg-light);
  padding: 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.9rem;
  margin: 16px 0;
  border-left: 3px solid var(--primary-color);
}

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== SELECTION CARDS ==================== */
.selection-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.selection-header {
  text-align: center;
  margin-bottom: 48px;
  color: white;
}

.selection-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.selection-header p {
  font-size: 1.125rem;
  opacity: 0.95;
}

.cards-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.selection-card {
  background: white;
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.selection-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transform: scaleX(0);
  transition: transform 0.3s;
}

.selection-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.selection-card:hover::before {
  transform: scaleX(1);
}

.card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.selection-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

.card-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

.selection-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.selection-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.card-arrow {
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: transform 0.3s;
}

.selection-card:hover .card-arrow {
  transform: translateX(8px);
}

/* ==================== FORM CONTAINER ==================== */
.form-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.back-button {
  background: var(--bg-light);
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
  margin: 24px 24px 0;
  transition: all 0.2s;
}

.back-button:hover {
  background: var(--border-color);
  transform: translateX(-4px);
}

.back-button svg {
  width: 20px;
  height: 20px;
}

/* ==================== FORM CONTENT ==================== */
.form-content {
  padding: 32px;
}

.form-header {
  text-align: center;
  margin-bottom: 40px;
}

.form-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-header p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==================== FORM INPUTS ==================== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.input-group input,
.input-group select,
.input-group textarea {
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.2s;
  font-family: inherit;
  background: white;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group input:disabled,
.input-group select:disabled {
  background: var(--bg-light);
  cursor: not-allowed;
  opacity: 0.6;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: #9ca3af;
}

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

/* ==================== REFERRAL CODE STYLES ==================== */
.referral-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.referral-input {
  flex: 1;
  padding-right: 48px;
}

.referral-input.valid {
  border-color: var(--success-color);
  background-color: rgba(16, 185, 129, 0.05);
}

.referral-input.invalid {
  border-color: var(--error-color);
  background-color: rgba(239, 68, 68, 0.05);
}

.referral-input.checking {
  border-color: var(--warning-color);
  background-color: rgba(245, 158, 11, 0.05);
}

.info-button {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: all 0.2s;
}

.info-button:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

.info-button svg {
  width: 18px;
  height: 18px;
}

.hint-text {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
  display: block;
}

.code-validation-status {
  font-size: 0.85rem;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  display: none;
}

.code-validation-status.valid {
  display: block;
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border-left: 3px solid var(--success-color);
}

.code-validation-status.invalid {
  display: block;
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border-left: 3px solid var(--error-color);
}

.code-validation-status.checking {
  display: block;
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
  border-left: 3px solid var(--warning-color);
}

/* ==================== CONSENT GROUP ==================== */
.consent-group {
  margin: 8px 0;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.consent-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.consent-label input[type="checkbox"]:checked ~ .checkmark {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.consent-label input[type="checkbox"]:checked ~ .checkmark::after {
  content: "✓";
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.consent-text {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

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

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

/* ==================== SUBMIT BUTTON ==================== */
.submit-button {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: var(--shadow-md);
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.submit-button svg {
  width: 20px;
  height: 20px;
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==================== FORM VISUAL ==================== */
.form-visual {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 500px;
}

.form-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .form-layout {
    grid-template-columns: 1fr;
  }

  .form-visual {
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .selection-header h1 {
    font-size: 2rem;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .form-content {
    padding: 24px;
  }

  .notification-container {
    left: 20px;
    right: 20px;
    max-width: none;
  }

  .notification {
    min-width: auto;
    max-width: none;
  }

  .modal-content {
    padding: 24px;
    margin: 0 16px;
  }
}

@media (max-width: 480px) {
  .selection-header h1 {
    font-size: 1.75rem;
  }

  .selection-card {
    padding: 32px 24px;
  }

  .card-icon {
    width: 64px;
    height: 64px;
  }

  .card-icon svg {
    width: 32px;
    height: 32px;
  }

  .modal-content {
    padding: 20px;
  }
}

/* ==================== VALIDATION STATES ==================== */
.input-group input.error,
.input-group select.error,
.input-group textarea.error {
  border-color: var(--error-color);
}

.input-group input.success,
.input-group select.success,
.input-group textarea.success {
  border-color: var(--success-color);
}

.error-message {
  font-size: 0.85rem;
  color: var(--error-color);
  margin-top: 4px;
  display: none;
}

.input-group.has-error .error-message {
  display: block;
}
