/* 
  SIPONKIA FORM LAYOUT
  Styles for Registration and Tracking forms.
*/

.card {
  background: white;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.8);
  width: 100%;
  max-width: 520px;
  position: relative;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 1.75rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Floating Labels */
.field {
  position: relative;
  margin-bottom: 1.5rem;
}

.field label {
  position: absolute;
  left: 1rem;
  top: 1.1rem;
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
  transition: all 0.25s ease;
}

.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label,
.field select:focus ~ label,
.field select:valid ~ label {
  top: -0.65rem;
  left: 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background: white;
  padding: 0 6px;
}

input, select {
  width: 100%;
  height: 3.5rem;
  padding: 0 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--text-main);
  background: transparent;
  transition: all 0.2s;
  font-weight: 500;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.08);
}

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}

/* Photo Uploader */
.uploader {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: 0.3s;
}

.uploader:hover {
  border-color: var(--primary);
  background: #f1f5f9;
}

.uploader i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  display: block;
}

.uploader p { font-weight: 700; font-size: 0.9rem; }
.uploader span { font-size: 0.8rem; color: var(--text-muted); }

#previewContainer {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

#imagePreview {
  width: 120px;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 8px;
  border: 4px solid white;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* Modals */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center;
  padding: 1.5rem; z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal-content { background: white; width: 100%; max-width: 480px; border-radius: 1.5rem; overflow: hidden; display: flex; flex-direction: column; max-height: 90vh; }
.modal-head { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-body { padding: 1rem; text-align: center; overflow-y: auto; flex-grow: 1; }
.modal-body img { max-width: 100%; border-radius: 12px; display: block; margin: 0 auto; }
.modal-footer { padding: 1rem; display: flex; gap: 0.75rem; background: #f8fafc; flex-shrink: 0; }

.btn-modal { flex: 1; height: 2.75rem; border-radius: 10px; font-weight: 700; border: none; cursor: pointer; transition: 0.2s; }
.btn-save { background: var(--primary); color: white; }
.btn-save:hover { background: #4f46e5; }
.btn-cancel { background: #fee2e2; color: #ef4444; }
.btn-cancel:hover { background: #fecaca; }

/* Loader */
.loading-full {
  position: fixed; inset: 0; background: white; display: none;
  flex-direction: column; align-items: center; justify-content: center; z-index: 2000;
}
.spinner {
  width: 50px; height: 50px; border: 5px solid #f1f5f9;
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Real-time Validation UI */
.field-error {
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 5px;
  display: none;
  animation: fadeIn 0.2s ease;
}

input.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fef2f2;
}

input.is-invalid:focus {
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

