* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #6C3483; --primary-light: #8E44AD; --primary-dark: #4A235A;
  --secondary: #F39C12; --bg: #f0f2f5; --card: #fff; --text: #2c3e50;
  --text-light: #7f8c8d; --border: #dfe6e9; --success: #27ae60;
  --danger: #e74c3c; --shadow: 0 2px 10px rgba(0,0,0,.1);
}
body { font-family: 'Segoe UI', Tahoma, sans-serif; background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); min-height: 100vh; display: flex; justify-content: center; padding: 20px; }
.container { max-width: 700px; width: 100%; background: var(--card); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.12); overflow: hidden; }
.header { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; padding: 30px; text-align: center; }
.business-name { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.header h1 { font-size: 18px; font-weight: 400; opacity: .9; margin-bottom: 5px; }
.header p { font-size: 14px; opacity: .8; }
.steps { padding: 25px; }
.step-indicator { display: flex; justify-content: space-between; margin-bottom: 30px; gap: 5px; }
.step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-light); font-weight: 500; white-space: nowrap; }
.step .step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--border); color: var(--text-light); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.step.active { color: var(--primary); }
.step.active .step-num { background: var(--primary); color: #fff; }
.step.done .step-num { background: var(--success); color: #fff; }
.step.done { color: var(--success); }
.step-content { display: none; }
.step-content.active { display: block; }
h2 { font-size: 18px; margin-bottom: 15px; color: var(--text); }
.search-box { margin-bottom: 15px; }
.search-box input { width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; transition: border .2s; }
.search-box input:focus { border-color: var(--primary); }
.services-grid { display: grid; gap: 8px; max-height: 400px; overflow-y: auto; padding: 2px; }
.service-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; transition: all .2s; }
.service-card:hover { border-color: var(--primary-light); }
.service-card.selected { border-color: var(--primary); background: rgba(108,52,131,.06); }
.service-card .s-color { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.service-card .s-info { flex: 1; min-width: 0; }
.service-card .s-name { font-weight: 600; font-size: 14px; }
.service-card .s-meta { font-size: 12px; color: var(--text-light); }
.service-card .s-price { font-weight: 700; font-size: 15px; color: var(--primary); white-space: nowrap; }
.date-picker { margin-bottom: 15px; }
.date-picker input { width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 15px; outline: none; }
.date-picker input:focus { border-color: var(--primary); }
.selected-info { font-size: 13px; color: var(--text-light); margin-top: 8px; padding: 8px 12px; background: var(--bg); border-radius: 8px; }
.slots-grid { max-height: 400px; overflow: auto; }

/* Slots table with rounded colored squares */
.slots-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.slots-table th { position: sticky; top: 0; background: var(--primary); color: #fff; padding: 8px 6px; font-weight: 600; text-align: center; white-space: nowrap; z-index: 2; font-size: 12px; }
.slots-table th:first-child { background: var(--primary-dark); z-index: 3; left: 0; }
.slots-table td { padding: 6px; text-align: center; border: 1px solid var(--border); }
.slots-table .st-time { background: var(--bg); font-weight: 600; color: var(--text); white-space: nowrap; position: sticky; left: 0; z-index: 1; font-size: 11px; }
.sq-clickable { cursor: pointer; }
.sq-cell { width: 36px; height: 36px; border-radius: 10px; display: inline-block; transition: all .15s; border: 2px solid transparent; }
.sq-free { background: #d5f5e3; border-color: #27ae60; cursor: pointer; }
.sq-free:hover { background: rgba(142,68,173,.15); border-color: #8E44AD; }
.sq-occ { background: #f5cba7; border-color: #e67e22; cursor: not-allowed; }
.sq-na { background: #f0f0f0; }
.sq-free.selected { background: rgba(142,68,173,.2) !important; border-color: #8E44AD !important; }
.no-slots { text-align: center; padding: 30px; color: var(--text-light); font-size: 14px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--text); }
.form-group input, .form-group textarea { width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; transition: border .2s; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 60px; }
.summary { background: var(--bg); border-radius: 10px; padding: 15px; margin: 15px 0; font-size: 13px; line-height: 1.8; }
.summary strong { color: var(--primary); }
.btn { padding: 10px 24px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }
.done-icon { font-size: 64px; text-align: center; margin: 20px 0; }
.footer { text-align: center; padding: 15px; font-size: 12px; color: var(--text-light); border-top: 1px solid var(--border); }
.loading { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,.8); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 999; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 500px) { .step-indicator { font-size: 10px; gap: 2px; } .step .step-num { width: 20px; height: 20px; font-size: 10px; } .slots-grid { grid-template-columns: repeat(3, 1fr); } #countdownDisplay { font-size: 36px !important; } }

/* Login / Register */
.btn-secondary { background: var(--text-light); color: #fff; }
.btn-secondary:hover { background: #6c757d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219653; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Client info */
.client-info { background: var(--bg); border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: 14px; }

/* Appt cards */
.appt-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--border); border-radius: 12px; margin-bottom: 10px; transition: all .2s; }
.appt-card:hover { border-color: var(--primary-light); }
.appt-card-past { opacity: .6; }
.appt-card-date { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.appt-card-day { font-size: 13px; font-weight: 600; color: var(--text); }
.appt-card-time { font-size: 16px; font-weight: 700; color: var(--primary); }
.appt-card-info { flex: 1; min-width: 0; }
.appt-card-date { position: relative; }
.appt-cal-tooltip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); z-index: 10; margin-bottom: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.appt-card-date:hover .appt-cal-tooltip { display: block; }
.mini-cal { border-collapse: collapse; font-size: 10px; }
.mini-cal th { padding: 2px 4px; color: var(--text-light); font-weight: 500; font-size: 9px; }
.mini-cal td { padding: 2px 4px; text-align: center; color: var(--text); }
.mini-cal td.mc-highlight { background: var(--primary); color: #fff; border-radius: 4px; font-weight: 700; }
.appt-card-service { font-weight: 600; font-size: 14px; }
.appt-card-notes { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.appt-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Section selector */
.form-select { width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; background: #fff; cursor: pointer; appearance: auto; }
.form-select:focus { border-color: var(--primary); }

/* Service combo - search + dropdown + add */
.service-combo { position: relative; margin-top: 12px; }
.service-dropdown { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; background: #fff; border: 2px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; max-height: 200px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.service-dropdown-item { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; transition: background .15s; font-size: 13px; }
.service-dropdown-item:hover { background: var(--bg); }
.service-dropdown-item .s-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.service-dropdown-item .s-name { flex: 1; }
.service-dropdown-item .s-price { font-weight: 600; color: var(--primary); font-size: 12px; white-space: nowrap; }
.service-dropdown-item.selected { background: rgba(108,52,131,.1); font-weight: 600; }

/* Selected services tags */
.selected-services-list { display: flex; flex-wrap: wrap; gap: 6px; }
.svc-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: rgba(108,52,131,.08); border: 1px solid var(--primary-light); border-radius: 20px; font-size: 12px; font-weight: 500; }
.svc-tag .svc-color { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.svc-tag .svc-remove { cursor: pointer; color: var(--danger); font-weight: 700; font-size: 14px; line-height: 1; margin-left: 2px; }
.svc-tag .svc-remove:hover { color: #c0392b; }

.btn-group { display: flex; gap: 8px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Salon-cancelled watermark */
.appt-card.appt-cancelled-by-salon { position: relative; overflow: hidden; border-color: #e74c3c !important; }
.appt-card.appt-cancelled-by-salon::before {
  content: "ANULADA POR EL SALÓN";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  background: rgba(231, 76, 60, 0.35);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 14px;
  z-index: 1;
  pointer-events: none;
  white-space: nowrap;
  border-radius: 4px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.appt-card.appt-cancelled-by-salon::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(231, 76, 60, 0.04) 8px,
    rgba(231, 76, 60, 0.04) 16px
  );
  z-index: 0;
  pointer-events: none;
}

/* Salon-modified card */
.appt-card.appt-modified-by-salon {
  border-left: 4px solid #e74c3c !important;
  background: #fff8f8;
}


/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: var(--card); border-radius: 16px; padding: 25px; max-width: 450px; width: 90%; max-height: 80vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 12px; right: 16px; font-size: 24px; cursor: pointer; color: var(--text-light); }
.modal-close:hover { color: var(--text); }
.modal h3 { margin-bottom: 15px; }