/* ================================================
   VIRTUAL TROUBLESHOOTING PORTAL — STYLES
   Customer portal: signup, login, dashboard, booking
   Extends the base troubleshoot.css design system
   ================================================ */

/* ---- Portal Layout ---- */
.ts-portal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--navy-950, #0a0e1a);
}

.ts-portal-main {
  flex: 1;
  padding: 100px 0 60px;
}

/* ---- Auth Pages (Signup / Login) ---- */
.ts-auth-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 var(--space-4, 16px);
}

.ts-auth-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 40px 36px;
  backdrop-filter: blur(20px);
}

.ts-auth-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.ts-auth-card .subtitle {
  color: rgba(255,255,255,.55);
  font-size: 0.95rem;
  margin-bottom: 32px;
  line-height: 1.5;
}

.ts-auth-card .alt-link {
  text-align: center;
  margin-top: 24px;
  color: rgba(255,255,255,.5);
  font-size: 0.9rem;
}

.ts-auth-card .alt-link a {
  color: var(--cyan-400, #00e5ff);
  text-decoration: none;
  font-weight: 600;
}

.ts-auth-card .alt-link a:hover {
  text-decoration: underline;
}

/* ---- Form Elements ---- */
.ts-form-group {
  margin-bottom: 20px;
}

.ts-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.ts-form-group label .required {
  color: #f87171;
}

.ts-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

.ts-input:focus {
  border-color: var(--cyan-400, #00e5ff);
  box-shadow: 0 0 0 3px rgba(0,229,255,.12);
}

.ts-input::placeholder {
  color: rgba(255,255,255,.25);
}

.ts-input--error {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248,113,113,.12);
}

textarea.ts-input {
  min-height: 100px;
  resize: vertical;
}

select.ts-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,.4)' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

select.ts-input option {
  background: #1a1f2e;
  color: #fff;
}

.ts-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ts-form-error {
  color: #f87171;
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.ts-form-error.visible {
  display: block;
}

/* ---- Buttons ---- */
.ts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-decoration: none;
}

.ts-btn--primary {
  background: linear-gradient(135deg, #00e5ff 0%, #007cf0 100%);
  color: #000;
  box-shadow: 0 4px 20px rgba(0,229,255,.25);
}

.ts-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0,229,255,.35);
}

.ts-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ts-btn--secondary {
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
}

.ts-btn--secondary:hover {
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.04);
}

.ts-btn--danger {
  background: rgba(248,113,113,.12);
  border: 1px solid rgba(248,113,113,.3);
  color: #f87171;
}

.ts-btn--danger:hover {
  background: rgba(248,113,113,.2);
}

.ts-btn--sm {
  padding: 10px 20px;
  font-size: 0.875rem;
}

.ts-btn--loading {
  pointer-events: none;
  opacity: 0.7;
}

.ts-btn--loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: ts-spin 0.6s linear infinite;
}

@keyframes ts-spin {
  to { transform: rotate(360deg); }
}

/* ---- Disclaimer / Terms ---- */
.ts-disclaimer {
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 0.78rem;
  line-height: 1.65;
  color: rgba(255,255,255,.5);
}

.ts-disclaimer h4 {
  color: rgba(255,255,255,.8);
  font-size: 0.85rem;
  margin: 12px 0 6px;
}

.ts-disclaimer h4:first-child {
  margin-top: 0;
}

.ts-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
}

.ts-checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--cyan-400, #00e5ff);
  flex-shrink: 0;
}

.ts-checkbox-group label {
  font-size: 0.85rem;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  line-height: 1.4;
}

/* ---- Alert Messages ---- */
.ts-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: none;
}

.ts-alert.visible {
  display: block;
}

.ts-alert--error {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.25);
  color: #fca5a5;
}

.ts-alert--success {
  background: rgba(74,222,128,.1);
  border: 1px solid rgba(74,222,128,.25);
  color: #86efac;
}

.ts-alert--info {
  background: rgba(0,229,255,.08);
  border: 1px solid rgba(0,229,255,.2);
  color: #67e8f9;
}

/* ---- Dashboard Cards ---- */
.ts-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.ts-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.2s;
}

.ts-card:hover {
  border-color: rgba(255,255,255,.15);
}

.ts-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.ts-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.ts-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(0,229,255,.1);
}

/* ---- Membership Badge ---- */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tier-pro {
  background: rgba(250,204,21,.12);
  color: #facc15;
  border: 1px solid rgba(250,204,21,.25);
}

.tier-vip {
  background: rgba(168,85,247,.12);
  color: #c084fc;
  border: 1px solid rgba(168,85,247,.25);
}

.tier-none {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.1);
}

.tier-elite {
  background: linear-gradient(135deg, rgba(253,224,71,.15), rgba(245,158,11,.15));
  color: #fde047;
  border: 1px solid rgba(253,224,71,.3);
}

/* ---- Booking Steps ---- */
.ts-steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 36px;
}

.ts-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.3);
  border: 2px solid rgba(255,255,255,.1);
  transition: all 0.3s;
}

.ts-step-dot.active {
  background: rgba(0,229,255,.15);
  border-color: var(--cyan-400, #00e5ff);
  color: var(--cyan-400, #00e5ff);
}

.ts-step-dot.done {
  background: rgba(74,222,128,.15);
  border-color: #4ade80;
  color: #4ade80;
}

.ts-step-line {
  width: 40px;
  height: 2px;
  background: rgba(255,255,255,.1);
  transition: background 0.3s;
}

.ts-step-line.done {
  background: #4ade80;
}

/* ---- Step Content ---- */
.ts-booking-step {
  display: none;
}

.ts-booking-step.active {
  display: block;
  animation: ts-fadeIn 0.3s ease;
}

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

.ts-step-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.ts-step-desc {
  color: rgba(255,255,255,.5);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* ---- Scheduler ---- */
.ts-scheduler {
  margin-top: 12px;
}

.ts-date-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  scrollbar-width: none;
}

.ts-date-picker::-webkit-scrollbar { display: none; }

.ts-date-btn {
  flex-shrink: 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.6);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  min-width: 80px;
  font-family: inherit;
}

.ts-date-btn:hover {
  border-color: rgba(255,255,255,.2);
  color: #fff;
}

.ts-date-btn.selected {
  border-color: var(--cyan-400, #00e5ff);
  background: rgba(0,229,255,.1);
  color: #fff;
}

.ts-date-btn.unavailable {
  opacity: 0.3;
  pointer-events: none;
}

.ts-date-btn .day-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  display: block;
}

.ts-date-btn .day-num {
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
}

.ts-date-btn .month {
  font-size: 0.68rem;
  opacity: 0.6;
  display: block;
}

.ts-time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.ts-time-btn {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.6);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.ts-time-btn:hover {
  border-color: rgba(255,255,255,.25);
  color: #fff;
}

.ts-time-btn.selected {
  border-color: var(--cyan-400, #00e5ff);
  background: rgba(0,229,255,.1);
  color: #fff;
}

.ts-time-btn.unavailable {
  opacity: 0.25;
  pointer-events: none;
  text-decoration: line-through;
}

/* ---- Service Selection Cards ---- */
.ts-service-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.ts-service-card {
  padding: 24px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.ts-service-card:hover {
  border-color: rgba(255,255,255,.2);
}

.ts-service-card.selected {
  border-color: var(--cyan-400, #00e5ff);
  background: rgba(0,229,255,.06);
}

.ts-service-card .service-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.ts-service-card .service-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.ts-service-card .service-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,.45);
  margin-bottom: 12px;
  line-height: 1.4;
}

.ts-service-card .service-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cyan-400, #00e5ff);
}

.ts-service-card .service-price .original {
  font-size: 0.85rem;
  color: rgba(255,255,255,.3);
  text-decoration: line-through;
  font-weight: 500;
  margin-left: 6px;
}

.ts-service-card .service-price-free {
  font-size: 1.3rem;
  font-weight: 800;
  color: #4ade80;
}

/* ---- Confirmation ---- */
.ts-confirmation {
  text-align: center;
  padding: 40px 20px;
}

.ts-confirmation-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(74,222,128,.12);
  border: 2px solid rgba(74,222,128,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 20px;
}

.ts-confirmation h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.ts-confirmation p {
  color: rgba(255,255,255,.55);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto 24px;
}

.ts-confirmation-details {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 20px;
  max-width: 380px;
  margin: 0 auto 28px;
  text-align: left;
}

.ts-confirmation-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 0.88rem;
}

.ts-confirmation-details .detail-row:last-child {
  border-bottom: none;
}

.ts-confirmation-details .detail-label {
  color: rgba(255,255,255,.45);
}

.ts-confirmation-details .detail-value {
  color: #fff;
  font-weight: 600;
}

/* ---- Appointments List (Dashboard) ---- */
.ts-appointment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ts-appointment-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  transition: border-color 0.2s;
}

.ts-appointment-item:hover {
  border-color: rgba(255,255,255,.12);
}

.ts-appointment-date {
  text-align: center;
  min-width: 54px;
}

.ts-appointment-date .month {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan-400, #00e5ff);
  letter-spacing: 0.05em;
}

.ts-appointment-date .day {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.ts-appointment-info {
  flex: 1;
}

.ts-appointment-info .appliance {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.ts-appointment-info .time {
  font-size: 0.82rem;
  color: rgba(255,255,255,.45);
  margin-top: 2px;
}

.ts-appointment-status {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-scheduled {
  background: rgba(0,229,255,.1);
  color: #67e8f9;
}

.status-completed {
  background: rgba(74,222,128,.1);
  color: #86efac;
}

.status-cancelled {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.35);
}

.status-no_answer {
  background: rgba(250,204,21,.1);
  color: #fde047;
}

/* ---- Empty States ---- */
.ts-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255,255,255,.35);
  font-size: 0.9rem;
}

.ts-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ---- Profile Section ---- */
.ts-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.ts-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00e5ff 0%, #007cf0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #000;
  flex-shrink: 0;
}

.ts-profile-info h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.ts-profile-info p {
  color: rgba(255,255,255,.45);
  font-size: 0.88rem;
}

/* ---- Model Number Locator ---- */
.ts-model-loc {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.ts-model-loc:hover {
  border-color: rgba(0,229,255,.2);
  background: rgba(0,229,255,.04);
}

.ts-model-loc.highlighted {
  border-color: rgba(0,229,255,.4);
  background: rgba(0,229,255,.08);
}

.ts-model-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(0,229,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Brand Pills ---- */
.ts-brand-pill {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}

.ts-brand-pill:hover {
  background: rgba(0,229,255,.08);
  border-color: rgba(0,229,255,.2);
  color: #fff;
}

/* ---- Plan Management Modal ---- */
.ts-plan-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  overflow-y: auto;
  padding: 20px;
}

.ts-plan-modal-overlay.visible {
  display: block;
}

.ts-plan-modal {
  max-width: 780px;
  margin: 60px auto;
  background: rgba(20,25,40,.97);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 36px 28px;
}

.ts-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.ts-plan-option {
  padding: 24px 18px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  text-align: center;
  transition: all 0.2s;
}

.ts-plan-option.current {
  border-color: rgba(74,222,128,.3);
  background: rgba(74,222,128,.06);
}

.ts-plan-option:hover {
  border-color: rgba(0,229,255,.3);
}

.ts-plan-option .plan-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.ts-plan-option .plan-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cyan-400, #00e5ff);
  margin: 8px 0;
}

.ts-plan-option .plan-price .period {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,.4);
}

.ts-plan-option .plan-features {
  text-align: left;
  font-size: 0.8rem;
  color: rgba(255,255,255,.55);
  line-height: 1.8;
  margin-top: 12px;
}

.ts-plan-option .plan-features .check {
  color: #4ade80;
  margin-right: 4px;
}

/* ---- Call History Expandable ---- */
.ts-call-item {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  transition: border-color 0.2s;
  overflow: hidden;
}

.ts-call-item:hover {
  border-color: rgba(255,255,255,.12);
}

.ts-call-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  cursor: pointer;
  user-select: none;
}

.ts-call-expand {
  color: rgba(255,255,255,.3);
  font-size: 0.8rem;
  transition: transform 0.2s;
  margin-left: auto;
  flex-shrink: 0;
}

.ts-call-item.expanded .ts-call-expand {
  transform: rotate(180deg);
}

.ts-call-detail {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 0;
}

.ts-call-item.expanded .ts-call-detail {
  display: block;
}

.ts-call-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.ts-call-detail-row:last-child {
  border-bottom: none;
}

.ts-call-detail-row .label {
  color: rgba(255,255,255,.4);
}

.ts-call-detail-row .value {
  color: #fff;
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .ts-auth-card {
    padding: 28px 20px;
  }

  .ts-form-row {
    grid-template-columns: 1fr;
  }

  .ts-service-options {
    grid-template-columns: 1fr;
  }

  .ts-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .ts-time-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .ts-plan-grid {
    grid-template-columns: 1fr;
  }

  .ts-model-loc {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    align-items: center;
  }

  .ts-call-header {
    flex-wrap: wrap;
  }
}
