/**
 * Career Page Styles — Beads of Brilliance
 * Page-specific styles for the teacher career application form.
 */

/* ═══════════════════════════════════════════════════════════════
   Task 3.1: Page-level and section styles
   ═══════════════════════════════════════════════════════════════ */

/* Hero / Intro Section */
.career-intro {
  background: linear-gradient(135deg, #1a237e, #4a90e2);
  color: #fff;
  padding: 3rem 1.5rem;
  text-align: center;
}

.career-intro .page-title {
  color: #fff;
}

.career-intro .page-subtitle {
  color: rgba(255, 255, 255, 0.9);
}

/* Description paragraph — constrained width for readability */
.career-description {
  max-width: 720px;
  margin: 1rem auto 0;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}

/* Form Section (fieldset) */
.form-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  margin-bottom: 2rem;
  border: none;
}

/* Section Title (legend) */
.form-section-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a237e;
  padding: 0 0.5rem;
  margin-bottom: 1rem;
}

/* Two-column grid rows */
.career-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Form group wrapper */
.career-form .form-group {
  margin-bottom: 1.25rem;
}

/* Labels */
.career-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #333;
}

/* Text inputs, selects, textarea */
.career-form input[type="text"],
.career-form input[type="email"],
.career-form input[type="tel"],
.career-form input[type="number"],
.career-form input[type="date"],
.career-form select,
.career-form textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.career-form input[type="text"]:focus,
.career-form input[type="email"]:focus,
.career-form input[type="tel"]:focus,
.career-form input[type="number"]:focus,
.career-form input[type="date"]:focus,
.career-form select:focus,
.career-form textarea:focus {
  border-color: #4a90e2;
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Select — custom dropdown arrow */
.career-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
    no-repeat right 1rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

/* Textarea */
.career-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* ═══════════════════════════════════════════════════════════════
   Task 3.2: Form element and feedback styles
   ═══════════════════════════════════════════════════════════════ */

/* Radio and Checkbox groups */
.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

/* Field error messages */
.field-error {
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 0.3rem;
  display: none;
}

.field-error.visible {
  display: block;
}

/* Error state on inputs */
.career-form input.error,
.career-form select.error,
.career-form textarea.error {
  border-color: #dc3545;
}

/* Photo preview */
.photo-preview-container {
  margin-top: 0.75rem;
}

/* Other subject input container */
.other-subject-input {
  margin-top: 0.75rem;
}

.other-subject-input label {
  font-weight: 500;
  margin-bottom: 0.3rem;
  display: block;
  color: #333;
}

.photo-preview {
  max-width: 150px;
  max-height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #ddd;
  display: none;
}

.photo-preview.visible {
  display: block;
}

/* Form notification messages */
.form-message {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  display: none;
  font-weight: 500;
}

.form-message.success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Submit button */
.submit-button {
  display: block;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #1a237e, #4a90e2);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 1rem;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.submit-button:disabled,
.submit-button.loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.submit-button.loading::after {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Spinner keyframes */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════════════
   Responsive — Mobile (< 768px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .career-form .form-row {
    grid-template-columns: 1fr;
  }

  .form-section {
    padding: 1.25rem;
  }
}
