/* ============================================================
   CiaoDott Onboarding Client – Styles
   ============================================================ */

:root {
  --primary: #0063a3;
  --primary-light: #0a9eed;
  --primary-dark: #055587;
  --accent: #34b6fc;
  --bg: #f0f8ff;
  --surface: #ffffff;
  --text: #072c4a;
  --text-muted: #6b7c8a;
  --border: #d0dce5;
  --success: #2e7d32;
  --success-bg: #e8f5e9;
  --danger: #c62828;
  --danger-bg: #fce4ec;
  --warning: #f57f17;
  --warning-bg: #fff8e1;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
  --transition: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Layout ---- */

.page-header {
  background: var(--primary);
  color: #fff;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.page-header h1 { font-size: 20px; font-weight: 600; }
.page-header .logo { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }

.container {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 20px;
}
.container.wide { max-width: 1100px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 24px;
}

/* ---- Stepper ---- */

.stepper {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  overflow-x: auto;
}
.stepper-item {
  flex: 1;
  text-align: center;
  padding: 10px 6px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 3px solid var(--border);
  white-space: nowrap;
  cursor: default;
  transition: var(--transition);
}
.stepper-item.active {
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.stepper-item.done {
  color: var(--success);
  border-color: var(--success);
}

/* ---- Form ---- */

.form-step { display: none; }
.form-step.active { display: block; }

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="time"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-light);
}
textarea { resize: vertical; min-height: 80px; }

.char-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.row { display: flex; gap: 16px; }
.row > * { flex: 1; }

/* ---- Checkboxes ---- */

.checkbox-group { display: flex; flex-direction: column; gap: 10px; }

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}
.checkbox-item:hover { border-color: var(--primary-light); }
.checkbox-item input { width: 18px; height: 18px; accent-color: var(--primary); }
.checkbox-item.required::after {
  content: "Obbligatorio";
  margin-left: auto;
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

/* ---- Radio cards ---- */

.radio-cards { display: flex; gap: 16px; }
.radio-card {
  flex: 1;
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.radio-card:hover { border-color: var(--primary-light); }
.radio-card.selected { border-color: var(--primary); background: #f0f7ff; }
.radio-card h3 { font-size: 15px; margin-bottom: 4px; }
.radio-card p { font-size: 12px; color: var(--text-muted); }

/* ---- Schedules ---- */

.schedule-grid { display: flex; flex-direction: column; gap: 8px; }
.schedule-day {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #eef3f7;
}
.schedule-day .day-name { width: 80px; font-weight: 600; font-size: 13px; }
.schedule-day .times { display: flex; gap: 8px; align-items: center; flex: 1; flex-wrap: wrap; }
.schedule-day input[type="time"] { width: 110px; padding: 6px 8px; font-size: 13px; }
.schedule-day .sep { color: var(--text-muted); font-size: 13px; }
.closed-toggle { font-size: 12px; color: var(--danger); cursor: pointer; user-select: none; }
.closed-toggle.is-closed { font-weight: 600; }

/* ---- File upload ---- */

.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.file-drop:hover, .file-drop.dragover { border-color: var(--primary-light); background: #f0f7ff; }
.file-drop .icon { font-size: 36px; margin-bottom: 8px; }
.file-drop .name { font-size: 13px; }
.file-drop .selected-file { color: var(--success); font-weight: 600; margin-top: 8px; }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-secondary { background: #e8eef3; color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #d0dce5; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #1b5e20; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8e0000; }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: 12px; margin-top: 28px; justify-content: space-between; }

/* ---- Alerts ---- */

.alert {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: #e3f2fd; color: var(--primary); }

/* ---- Summary ---- */

.summary-section { margin-bottom: 20px; }
.summary-section h3 { font-size: 15px; color: var(--primary); margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.summary-row { display: flex; padding: 4px 0; font-size: 14px; }
.summary-row .label { width: 180px; font-weight: 600; flex-shrink: 0; }
.summary-row .value { color: var(--text-muted); }

/* ---- Progress bar ---- */

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 24px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  transition: width .4s ease;
}

/* ---- Admin panel ---- */

.admin-login { max-width: 400px; margin: 80px auto; }

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}
.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  color: var(--text-muted);
  transition: var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.tab .badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  background: #e8eef3;
  margin-left: 6px;
}

.reg-list { display: flex; flex-direction: column; gap: 12px; }

.reg-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
}
.reg-item:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.reg-item .info { flex: 1; }
.reg-item .name { font-weight: 600; font-size: 15px; }
.reg-item .email { font-size: 13px; color: var(--text-muted); }
.reg-item .meta { font-size: 12px; color: var(--text-muted); }

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge.pending_verification { background: #fff3e0; color: #e65100; }
.status-badge.pending_approval { background: #e3f2fd; color: #1565c0; }
.status-badge.approved_creating { background: var(--warning-bg); color: var(--warning); }
.status-badge.completed { background: var(--success-bg); color: var(--success); }
.status-badge.rejected { background: var(--danger-bg); color: var(--danger); }
.status-badge.expired { background: #f5f5f5; color: #9e9e9e; }

/* ---- Detail panel ---- */

.detail-panel {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: 520px;
  height: 100vh;
  background: var(--surface);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  overflow-y: auto;
  z-index: 100;
  padding: 28px;
}
.detail-panel.open { display: block; }
.detail-panel .close-btn {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  font-size: 24px; cursor: pointer;
  color: var(--text-muted);
}
.detail-panel h2 { font-size: 18px; margin-bottom: 20px; }
.detail-panel .actions { display: flex; gap: 10px; margin-top: 24px; }

.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 99; }
.overlay.open { display: block; }

/* ---- Verify page ---- */

.verify-card {
  max-width: 500px;
  margin: 80px auto;
  text-align: center;
}
.verify-card h2 { margin-bottom: 12px; }
.verify-card p { color: var(--text-muted); margin-bottom: 20px; }
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Responsive ---- */

/* ---- Landing page ---- */

a.landing-card {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: var(--transition);
}
a.landing-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

/* ---- Google Sign-In ---- */

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: 'Roboto', -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}
.google-signin-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.google-signin-success {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 16px;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
  .container { padding: 0 12px; }
  .card { padding: 20px; }
  .row { flex-direction: column; gap: 0; }
  .radio-cards { flex-direction: column; }
  .btn-group { flex-direction: column; }
  .detail-panel { width: 100%; }
  .summary-row { flex-direction: column; }
  .summary-row .label { width: auto; }
}
