/* ================================
   Form Layout
   ================================ */
.form-section {
  padding: 2rem 0 4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}

.form-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ================================
   Form Cards
   ================================ */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition);
}

.form-card:hover {
  border-color: var(--border-color);
  box-shadow: var(--shadow-md);
}

.form-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.form-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(79, 195, 247, 0.1);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.form-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ================================
   Form Rows & Groups
   ================================ */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row-3col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group-full {
  flex: 1;
}

.form-group-2span {
  grid-column: span 2;
}

@media (max-width: 640px) {
  .form-row-2col,
  .form-row-3col {
    grid-template-columns: 1fr;
  }

  .form-group-2span {
    grid-column: span 1;
  }
}

/* ================================
   Labels & Inputs
   ================================ */
.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.required {
  color: var(--accent-red);
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:hover,
.form-select:hover {
  border-color: var(--text-muted);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.15);
}

.form-input.is-invalid,
.form-select.is-invalid {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.15);
}

.form-input.is-valid,
.form-select.is-valid {
  border-color: var(--accent-green);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-error {
  font-size: 0.75rem;
  color: var(--accent-red);
  display: none;
}

.form-error.show {
  display: block;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ================================
   Select Wrapper
   ================================ */
.select-wrapper {
  position: relative;
}

.select-wrapper .form-select {
  appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
}

.select-wrapper .form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-primary);
}

.select-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ================================
   Radio Group
   ================================ */
.radio-group {
  display: flex;
  gap: 0.75rem;
}

.radio-option {
  flex: 1;
  position: relative;
}

.radio-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.radio-label:hover {
  border-color: var(--text-muted);
}

.radio-active input:checked + .radio-label {
  background: rgba(129, 199, 132, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.radio-inactive input:checked + .radio-label {
  background: rgba(239, 83, 80, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ================================
   Location Preview
   ================================ */
.location-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(79, 195, 247, 0.1);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--accent-blue);
}

/* ================================
   Form Actions
   ================================ */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
}

.btn-submit {
  min-width: 160px;
  justify-content: center;
}

.btn-submit.loading {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

.btn-submit.loading span::after {
  content: "...";
  animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: "";
  }
  40% {
    content: ".";
  }
  60% {
    content: "..";
  }
  80%,
  100% {
    content: "...";
  }
}

/* ================================
   Sidebar Info Cards
   ================================ */
.form-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 6rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.info-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 0.4rem;
}

/* Preview Card */
.preview-card {
  border-color: var(--accent-purple);
  background: linear-gradient(
    135deg,
    rgba(206, 147, 216, 0.05) 0%,
    var(--bg-card) 100%
  );
}

.preview-card .info-title {
  color: var(--accent-purple);
}

.preview-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.preview-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.preview-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.preview-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
  max-width: 60%;
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 1024px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .info-card {
    flex: 1;
    min-width: 280px;
  }
}

@media (max-width: 768px) {
  .form-card {
    padding: 1.25rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-submit {
    min-width: auto;
  }

  .form-sidebar {
    flex-direction: column;
  }

  .info-card {
    min-width: auto;
  }
}

/* ================================
   Animations
   ================================ */
.form-card,
.info-card {
  animation: fadeInUp 0.5s ease-out;
}

.form-card:nth-child(1) {
  animation-delay: 0s;
}
.form-card:nth-child(2) {
  animation-delay: 0.05s;
}
.form-card:nth-child(3) {
  animation-delay: 0.1s;
}
.form-card:nth-child(4) {
  animation-delay: 0.15s;
}
.form-card:nth-child(5) {
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
