/* ========================================
   Goodwill Learning Centre - Form Styles
   ======================================== */

.form-section {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-row.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-checkbox label {
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.form-note {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.75rem;
}

.ml-auto {
  margin-left: auto;
}

.sidebar-signout-btn {
  color: var(--sidebar-foreground);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border, #eee);
}

.modal-body {
  padding: 1.5rem;
}

.reg-field {
  margin-bottom: 0.75rem;
}

.reg-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground, #888);
  margin-bottom: 0.125rem;
}

.reg-value {
  font-size: 0.9rem;
  color: var(--foreground, #111);
}

.grade-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.grade-cb-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s ease;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background: #fff;
}

.grade-cb-label:hover {
  border-color: var(--primary, #2563EB);
  background: rgba(37, 99, 235, 0.04);
}

.grade-cb-label.checked {
  border-color: var(--primary, #2563EB);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary, #2563EB);
}

.grade-cb-label input[type="checkbox"] {
  display: none;
}

.grade-cb-label .cb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.grade-cb-label.checked .cb-dot {
  background: var(--primary, #2563EB);
  border-color: var(--primary, #2563EB);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.status-message-muted,
.status-message-error,
.status-message-success {
  font-size: 0.8rem;
}

.status-message-muted {
  color: var(--muted-foreground, #94A3B8);
}

.status-message-error {
  color: var(--destructive, #ef4444);
}

.status-message-success {
  color: var(--success, #22c55e);
}

.inline-code {
  font-size: 0.7rem;
  background: var(--muted);
  padding: 1px 4px;
  border-radius: 3px;
}

.student-action-cell {
  white-space: nowrap;
}

.student-action-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.student-action-wrap .btn {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
}

.student-details-divider {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border, #eee);
}

.student-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
}

.student-details-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #eee);
}

.student-modal-sep {
  margin: 1.25rem 0;
  border: none;
  border-top: 1px solid var(--border, #eee);
}

.book-cover-input {
  padding: 0.375rem;
}

.book-cover-preview {
  margin-top: 0.5rem;
  display: none;
}

.book-cover-preview.visible {
  display: block;
}

.book-cover-preview-img {
  max-width: 200px;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--background);
}

.book-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--background);
}

.book-thumb-placeholder {
  width: 48px;
  height: 48px;
  background: var(--muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ── Note file upload drop areas (admin Notes form) ── */
.nt-file-drop {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border: 1.5px dashed var(--border, #cbd5e1);
  border-radius: 0.6rem;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nt-file-drop:hover {
  border-color: var(--gw-primary, #2563eb);
  background: #eff6ff;
}

.nt-file-drop i {
  font-size: 1.25rem;
  color: var(--gw-primary, #2563eb);
}

.nt-file-drop .nt-file-drop-text {
  font-size: 0.82rem;
  font-weight: 500;
}

.nt-file-drop .nt-file-drop-name {
  margin-left: auto;
  font-size: 0.75rem;
  color: #16a34a;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nt-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.nt-image-preview {
  margin-top: 0.6rem;
  max-height: 180px;
  max-width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--border, #e2e8f0);
  object-fit: contain;
  background: #f1f5f9;
}

/* Inline validation */
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Auth forms */
.auth-container {
  max-width: 28rem;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.auth-container.wide {
  max-width: 48rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
}

.auth-header p {
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.auth-card {
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: var(--shadow-sm);
}

.auth-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 1.5rem;
}

/* Duration selector */
.duration-selector {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.duration-selector .btn.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.duration-input {
  width: 5rem;
}