/* ====================================
   REGISTRATION PAGE - CLEAN PROFESSIONAL DESIGN
   PARTSFORM Color Scheme: #2B5278 (primary), #3B82F6 (accent)
   ==================================== */

/* ====================================
   BASE STYLES
   ==================================== */
.register-section {
  min-height: 100vh;
  background: #f8fafc;
  padding: 7rem 0 3rem;
  position: relative;
}

/* ====================================
   CONTAINER LAYOUT
   ==================================== */
.register-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 12rem);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ====================================
   FORM WRAPPER - CENTERED
   ==================================== */
.register-form-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 620px;
}

.register-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem 2.5rem;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.register-card-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.register-card-header .header-logo {
  margin-bottom: 1rem;
}

.register-card-header .logo-img {
  height: 32px;
  width: auto;
}

.register-card-header h2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.375rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.375rem;
}

.register-card-header p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

/* ====================================
   FORM SECTIONS
   ==================================== */
.form-section {
  margin-bottom: 0.875rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(43, 82, 120, 0.08);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0.75rem;
  padding-bottom: 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  color: #2b5278;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-section-title svg {
  width: 14px;
  height: 14px;
}

/* Form Row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 0.5rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #1a2b3d;
  margin-bottom: 0.25rem;
}

.form-group label .required {
  color: #dc2626;
}

/* Input Wrapper */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  width: 14px;
  height: 14px;
  color: #94a3b8;
  transition: color 0.3s ease;
  pointer-events: none;
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  color: #1a2b3d;
  background: #f8fafb;
  border: 1px solid rgba(43, 82, 120, 0.12);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.input-wrapper textarea {
  resize: vertical;
  min-height: 100px;
  padding-top: 0.875rem;
}

.textarea-wrapper .textarea-icon {
  top: 1rem;
  align-self: flex-start;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-wrapper:focus-within .input-icon {
  color: #3b82f6;
}

.input-wrapper input::placeholder,
.input-wrapper textarea::placeholder {
  color: #94a3b8;
}

/* Select Styling */
.select-wrapper select {
  appearance: none;
  cursor: pointer;
  padding-right: 3rem;
}

.select-wrapper .select-arrow {
  position: absolute;
  right: 1rem;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
  transition: transform 0.3s ease, color 0.3s ease;
}

.select-wrapper select:focus + .select-arrow {
  color: #3b82f6;
  transform: rotate(180deg);
}

/* Password Field */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  color: #94a3b8;
  transition: color 0.3s ease;
}

.password-toggle:hover svg {
  color: #3b82f6;
}

/* Password Strength */
.password-strength {
  margin-top: 0.5rem;
}

.strength-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.strength-text {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

/* Password Match */
.password-match-text {
  font-size: 0.75rem;
  margin: 0.5rem 0 0;
  min-height: 1rem;
}

.input-wrapper input.success {
  border-color: #10b981;
}

.input-wrapper input.error {
  border-color: #dc2626;
}

/* ====================================
   TERMS & CHECKBOXES
   ==================================== */
.terms-section {
  border-bottom: none !important;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.form-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #3b82f6;
  cursor: pointer;
  flex-shrink: 0;
}

.form-checkbox label {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.5;
  cursor: pointer;
}

.form-checkbox label a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.form-checkbox label a:hover {
  color: #2b5278;
  text-decoration: underline;
}

/* ====================================
   SUBMIT BUTTON
   ==================================== */
.register-submit-btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #ffffff;
  background: #2b5278;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.register-submit-btn:hover {
  background: #1e3f5a;
}

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

.register-submit-btn .btn-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.register-submit-btn:hover .btn-icon {
  transform: translateX(3px);
}

.register-submit-btn.loading {
  pointer-events: none;
  opacity: 0.9;
}

/* Spinner */
.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

.spinner-circle {
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-dasharray: 40, 60;
  stroke-dashoffset: 0;
}

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

/* ====================================
   LOGIN LINK
   ==================================== */
.register-login-link {
  text-align: center;
  margin-top: 1.5rem;
}

.register-login-link p {
  font-size: 0.9375rem;
  color: #64748b;
  margin: 0;
}

.register-login-link a {
  color: #3b82f6;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.register-login-link a:hover {
  color: #2b5278;
  text-decoration: underline;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */
@media (max-width: 1200px) {
  .register-container {
    gap: 3rem;
  }
  
  .register-branding-title {
    font-size: 2.25rem;
  }
}

@media (max-width: 992px) {
  .register-section {
    padding: 6rem 0 3rem;
  }
  
  .register-container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 768px) {
  .register-section {
    padding: 5rem 0 2rem;
  }
  
  .register-card {
    padding: 2rem;
    border-radius: 20px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }
}

@media (max-width: 480px) {
  .register-section {
    padding: 4.5rem 0 1.5rem;
  }
  
  .register-container {
    padding: 0 1rem;
  }
  
  .register-card {
    padding: 1.5rem;
    border-radius: 16px;
  }
  
  .register-card-header h2 {
    font-size: 1.5rem;
  }
  
  .form-section-title {
    font-size: 0.8rem;
  }
  
  .register-submit-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
  }
}

/* ====================================
   ERROR & SUCCESS MESSAGES
   ==================================== */
.form-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

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

.form-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #059669;
}

.form-message i,
.form-message svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.field-error {
  color: #dc2626;
  font-size: 0.75rem;
  margin-top: 0.375rem;
  min-height: 1rem;
  display: block;
}

.input-wrapper.error {
  border-color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.03);
}

.input-wrapper.error:focus-within {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  border-color: #dc2626;
}

.input-wrapper.success {
  border-color: #10b981 !important;
}

.input-wrapper.success:focus-within {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  border-color: #10b981;
}

/* ====================================
   REFERRAL CODE SECTION
   ==================================== */
.referral-section {
  background: linear-gradient(135deg, rgba(43, 82, 120, 0.03) 0%, rgba(59, 130, 246, 0.03) 100%);
  border-radius: 8px;
  padding: 1rem !important;
  margin: 1rem 0 !important;
  border: 1px dashed rgba(43, 82, 120, 0.2) !important;
}

.referral-section .form-section-title {
  color: #2B5278;
}

.referral-section .form-section-title small {
  font-size: 0.75rem;
}

.referral-code-wrapper {
  position: relative;
}

.referral-code-wrapper input {
  padding-right: 90px;
}

.validate-code-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #2B5278;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.validate-code-btn:hover {
  background: #1e3a5f;
}

.validate-code-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

.validate-code-btn i {
  width: 14px;
  height: 14px;
}

.referral-code-status {
  margin-top: 0.5rem;
}

.referral-valid,
.referral-invalid {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

.referral-valid {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.referral-valid i {
  width: 16px;
  height: 16px;
  color: #10b981;
}

.referral-invalid {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.referral-invalid i {
  width: 16px;
  height: 16px;
}

.referral-section .form-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Referral input states */
#referralCode.valid {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.03);
}

#referralCode.invalid {
  border-color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.03);
}