/* Chess Academy - Registration Page Styles */

/* ===== REGISTRATION SPECIFIC STYLES ===== */

/* Registration container improvements */
.registration-container {
  min-height: 100vh;
  padding: calc(76px + 2rem) 1rem 2rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.registration-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* Header styling */
.registration-header {
  text-align: center;
  margin-bottom: 2rem;
}

.registration-header h1 {
  color: #667eea;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.registration-header .subtitle {
  color: #6c757d;
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 0;
}

/* Form styling improvements */
.registration-form {
  margin-top: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-label .required {
  color: #e74c3c;
  margin-left: 2px;
}

.form-control {
  border: 2px solid #e9ecef;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #fff;
}

.form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
  background-color: #fff;
}

.form-control.is-invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.15);
}

.form-control.is-valid {
  border-color: #27ae60;
  box-shadow: 0 0 0 0.2rem rgba(39, 174, 96, 0.15);
}

/* Name fields styling - improved alignment */
.name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.name-field {
  display: flex;
  flex-direction: column;
}

/* Form text styling */
.form-text {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* Terms and conditions styling */
.terms-section {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #667eea;
}

.form-check-label {
  font-size: 0.95rem;
  line-height: 1.5;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: #667eea;
  border-color: #667eea;
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Submit button styling */
.submit-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

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

.submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Loading spinner */
.spinner-overlay {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Login link section */
.login-link-section {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

.login-link-section p {
  margin-bottom: 0;
  color: #6c757d;
}

.login-link-section a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.login-link-section a:hover {
  color: #5a6fd8;
  text-decoration: underline;
}

/* Benefits section styling */
.benefits-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

.benefits-title {
  text-align: center;
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}

.benefit-item {
  padding: 1rem;
  border-radius: 10px;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

.benefit-item:hover {
  background-color: #e9ecef;
  transform: translateY(-2px);
}

.benefit-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.benefit-text {
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}

/* Alert styling improvements */
.alert {
  border-radius: 12px;
  border: none;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background-color: #d4edda;
  border-left: 4px solid #27ae60;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  border-left: 4px solid #e74c3c;
  color: #721c24;
}

.alert-info {
  background-color: #d1ecf1;
  border-left: 4px solid #17a2b8;
  color: #0c5460;
}

/* Modal improvements */
.modal-content {
  border-radius: 15px;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  border-radius: 15px 15px 0 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.modal-header .btn-close {
  filter: invert(1);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  border-radius: 0 0 15px 15px;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large tablets and small desktops */
@media (max-width: 991.98px) {
  .registration-card {
    padding: 30px;
    margin: 1rem;
  }

  .registration-container {
    padding: 1.5rem 0.5rem;
  }

  .name-fields {
    gap: 1.25rem;
  }
}

/* Tablets */
@media (max-width: 767.98px) {
  .registration-container {
    padding: calc(60px + 1.5rem) 0.5rem 1.5rem 0.5rem;
  }

  .registration-card {
    padding: 25px;
    border-radius: 15px;
  }

  .registration-header h1 {
    font-size: 2rem;
  }

  .registration-header .subtitle {
    font-size: 1rem;
  }

  /* Keep name fields side by side on tablets */
  .name-fields {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .benefits-grid {
    gap: 0.75rem;
  }

  .benefit-item {
    padding: 0.75rem;
  }

  .benefit-icon {
    font-size: 2rem;
  }

  /* Form improvements for tablet */
  .form-control {
    padding: 11px 15px;
  }

  .form-label {
    font-size: 0.92rem;
  }
}

/* Mobile phones */
@media (max-width: 575.98px) {
  .registration-container {
    padding: calc(56px + 1rem) 0.25rem 1rem 0.25rem;
    min-height: 100vh;
  }

  .registration-card {
    padding: 20px;
    border-radius: 12px;
    margin: 0.5rem;
  }

  /* Stack name fields on mobile */
  .name-fields {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .registration-header h1 {
    font-size: 1.75rem;
  }

  .registration-header .subtitle {
    font-size: 0.95rem;
  }

  .form-control {
    padding: 10px 14px;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .form-label {
    font-size: 0.9rem;
  }

  .form-text {
    font-size: 0.8rem;
  }

  .submit-button {
    padding: 12px 24px;
    font-size: 1rem;
  }

  .terms-section {
    padding: 0.75rem;
  }

  .form-check-label {
    font-size: 0.9rem;
  }

  .benefits-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
  }

  .benefits-title {
    font-size: 1.1rem;
  }

  .benefit-item {
    padding: 0.5rem;
  }

  .benefit-icon {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
  }

  .benefit-text {
    font-size: 0.8rem;
  }

  /* Modal adjustments for mobile */
  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-header,
  .modal-footer {
    padding: 1rem 1.5rem;
  }
}

/* Small mobile phones */
@media (max-width: 400px) {
  .registration-card {
    padding: 15px;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .benefit-item {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 0.75rem;
  }

  .benefit-icon {
    font-size: 2rem;
    margin-right: 1rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .benefit-text {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  /* Enhanced mobile form styling */
  .name-fields {
    gap: 1rem;
  }

  .form-group {
    margin-bottom: 1.25rem;
  }

  .registration-header {
    margin-bottom: 1.5rem;
  }
}

/* Focus and accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .form-control,
  .submit-button,
  .benefit-item {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .form-control {
    border-width: 3px;
  }

  .form-control:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
  }
}

/* Print styles */
@media print {
  .registration-container {
    background: white;
    padding: 1rem;
  }

  .registration-card {
    box-shadow: none;
    border: 1px solid #000;
  }

  .submit-button,
  .benefits-section {
    display: none;
  }
}

/* Form validation states */
.was-validated .form-control:invalid {
  border-color: #e74c3c;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23e74c3c'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4 1.4-1.4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid {
  border-color: #27ae60;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2327ae60' d='m2.3 6.73.94-.94 1.06 1.06L1.26 9.9zm4.37-4.37L4.94 4.09l2.83-2.83L8.49 2z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Invalid feedback styling */
.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #e74c3c;
}

.valid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #27ae60;
}

/* Focus trap for better accessibility */
.registration-card:focus-within {
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading state improvements */
.submit-button:disabled .spinner-overlay {
  opacity: 1;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Better touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
  .form-control {
    min-height: 44px;
  }

  .submit-button {
    min-height: 48px;
  }

  .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
  }
}
