/* 
 * Fácil Marcação - Client Portal CSS
 * Base on Design System
 */

:root {
  /* Colors */
  --primary: #d4af37;
  --primary-dark: #aa7c11;
  --primary-light: #f3e5ab;
  --bg-body: #070708;
  --bg-card: #121214;
  --bg-elevated: #18181c;
  --text-primary: #f3f3f6;
  --text-secondary: #a0a0ab;
  --text-muted: #62626e;
  --border-color: #222226;
  --border-soft: #2d2d34;
  
  /* Status Colors */
  --success: #10b981;
  --danger: #F0475B;
  --warning: #F5A524;
  --info: #3b82f6;

  /* Typography */
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Layout & Design */
  --radius-card: 10px;
  --radius-input: 8px;
  --radius-pill: 9999px;
  --shadow-base: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 15px rgba(212, 175, 55, 0.15);
  --transition: 250ms ease;
}

/* Global Reset for Client Portal */
.cliente-body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--primary-light);
}

* {
  box-sizing: border-box;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* -----------------------------------------------------
 * 1. CLIENT LOGIN PAGE
 * ----------------------------------------------------- */

.cliente-login-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 50% -20%, var(--bg-elevated) 0%, var(--bg-body) 100%);
  animation: fadeIn 0.5s ease;
}

.cliente-login-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-base);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cliente-login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.cliente-login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cliente-login-logo .emoji {
  font-size: 1.8rem;
}

.cliente-login-logo p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.loja-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  color: var(--primary-light);
  margin-top: 1rem;
}

.loja-info-badge i {
  color: var(--primary);
}

.cliente-login-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.cliente-login-tab {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
}

.cliente-login-tab:hover {
  color: var(--text-primary);
}

.cliente-login-tab.active {
  color: var(--primary);
}

.cliente-login-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

.cliente-form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.cliente-form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.cliente-input {
  width: 100%;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition);
}

.cliente-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.cliente-input::placeholder {
  color: var(--text-muted);
}

.cliente-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #000;
  border: none;
  padding: 0.875rem;
  border-radius: var(--radius-input);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.cliente-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  opacity: 0.95;
}

.cliente-btn-primary:active {
  transform: translateY(0);
}

.cliente-btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.875rem;
  border-radius: var(--radius-input);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.cliente-btn-secondary:hover {
  background-color: rgba(212, 175, 55, 0.1);
}

/* Step Indicator */
.cliente-step-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  position: relative;
}

.cliente-step-indicator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background-color: var(--border-color);
  transform: translateY(-50%);
  z-index: 1;
}

.cliente-step {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 2;
  position: relative;
  transition: all var(--transition);
}

.cliente-step.active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.cliente-step.done {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #000;
}

/* 6-Digit Code Input */
.cliente-code-inputs {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.cliente-code-input {
  width: 3rem;
  height: 3.5rem;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  text-align: center;
  font-size: 1.5rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition);
}

.cliente-code-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Messages */
.cliente-error, .cliente-success {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-input);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  animation: fadeIn 0.3s ease;
}

.cliente-error {
  background-color: rgba(240, 71, 91, 0.1);
  color: var(--danger);
  border: 1px solid rgba(240, 71, 91, 0.2);
}

.cliente-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.cliente-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.cliente-divider::before,
.cliente-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.cliente-divider:not(:empty)::before {
  margin-right: 1rem;
}

.cliente-divider:not(:empty)::after {
  margin-left: 1rem;
}

.cliente-link {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.cliente-link:hover {
  text-decoration: underline;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 2.1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1.1rem;
  transition: color var(--transition);
}

.password-toggle:hover {
  color: var(--text-primary);
}

.cliente-footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Spinner */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.cliente-btn-secondary .spinner {
  border: 2px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--primary);
}

/* -----------------------------------------------------
 * 2. CLIENT DASHBOARD
 * ----------------------------------------------------- */

.cliente-dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.cliente-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.cliente-header-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cliente-logo-small {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.cliente-user-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cliente-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all var(--transition);
}

.btn-logout:hover {
  color: var(--danger);
  background-color: rgba(240, 71, 91, 0.1);
}

/* Main Content */
.cliente-main {
  flex: 1;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.cliente-welcome {
  margin-bottom: 2.5rem;
  animation: fadeIn 0.6s ease;
}

.cliente-welcome h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.cliente-welcome p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Sections */
.cliente-section {
  margin-bottom: 3rem;
  animation: slideUp 0.6s ease;
}

.cliente-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.cliente-section-title i {
  color: var(--primary);
}

/* Filter Bar */
.cliente-filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cliente-filter-bar::-webkit-scrollbar {
  display: none;
}

.cliente-filter-pill {
  white-space: nowrap;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.cliente-filter-pill:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.cliente-filter-pill.active {
  background-color: var(--primary);
  color: #000;
  border-color: var(--primary);
}

/* Agendamento Card */
.cliente-agendamentos-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cliente-agendamento-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  display: flex;
  gap: 1.25rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.cliente-agendamento-card:hover {
  border-color: var(--border-soft);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}

/* Left side: Date */
.cliente-agendamento-date-badge {
  flex-shrink: 0;
  width: 4rem;
  height: 4.5rem;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-input);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.date-day {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.date-month {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Middle: Info */
.cliente-agendamento-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cliente-agendamento-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.cliente-agendamento-loja {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cliente-agendamento-service {
  font-size: 1.125rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.25rem 0;
}

.cliente-agendamento-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.pendente {
  background-color: rgba(245, 165, 36, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 165, 36, 0.2);
}

.status-badge.confirmado {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.concluido {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-badge.cancelado {
  background-color: rgba(240, 71, 91, 0.1);
  color: var(--danger);
  border: 1px solid rgba(240, 71, 91, 0.2);
}

/* Right side: Actions / Price */
.cliente-agendamento-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  text-align: right;
}

.cliente-agendamento-valor {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary-light);
  font-size: 1rem;
}

.btn-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  color: var(--danger);
  border-color: var(--danger);
  background-color: rgba(240, 71, 91, 0.1);
}

/* Lojas Grid */
.cliente-lojas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.cliente-loja-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}

.cliente-loja-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.cliente-loja-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background-color: var(--bg-elevated);
  border: 2px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.cliente-loja-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cliente-loja-stats {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  width: 100%;
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Empty State */
.cliente-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-card);
}

.cliente-empty-icon {
  font-size: 3rem;
  color: var(--border-soft);
  margin-bottom: 1rem;
}

.cliente-empty-state h3 {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.cliente-empty-state p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  max-width: 300px;
}

/* Grouping Header (if agendamentos are grouped by loja) */
.cliente-loja-group {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-light);
  margin: 1.5rem 0 1rem 0;
  padding-left: 0.5rem;
  border-left: 3px solid var(--primary);
}

/* -----------------------------------------------------
 * 3. RESPONSIVE DESIGN
 * ----------------------------------------------------- */

@media (max-width: 640px) {
  .cliente-login-card {
    padding: 2rem 1.5rem;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  
  .cliente-login-container {
    padding: 0;
    justify-content: flex-start;
    padding-top: 2rem;
  }

  .cliente-agendamento-card {
    flex-direction: column;
    gap: 1rem;
  }

  .cliente-agendamento-date-badge {
    flex-direction: row;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-soft);
    border-radius: 0;
    justify-content: flex-start;
  }

  .date-day {
    font-size: 1.25rem;
  }

  .date-month {
    margin-top: 0;
  }

  .cliente-agendamento-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cliente-agendamento-actions {
    flex-direction: row;
    align-items: center;
    border-top: 1px solid var(--border-soft);
    padding-top: 1rem;
    margin-top: 0.5rem;
  }
  
  .cliente-code-input {
    width: 2.5rem;
    height: 3rem;
    font-size: 1.25rem;
  }
}
