/* ============================================
   AllMed Solution - Portal Styles
   Client Dashboard & Authentication
   ============================================ */

/* --- Auth Pages (Login/Register) --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg-light);
}

.auth-left {
  flex: 1;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 30% 40%, rgba(99, 91, 255, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(0, 212, 170, 0.2) 0%, transparent 50%);
}

.auth-left-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  color: white;
}

.auth-left-content h2 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.auth-left-content p {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
}

.auth-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(0, 212, 170, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-feature-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
}

.auth-feature-text h4 {
  color: white;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.auth-feature-text p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-form-container {
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  display: inline-block;
  margin-bottom: 36px;
}

.auth-logo .logo-img {
  height: 50px;
  width: auto;
}

.auth-logo span {
  color: var(--accent);
}

.auth-form-container h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.auth-form-container > p {
  color: var(--text-light);
  margin-bottom: 32px;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form .form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-form .form-group input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 1rem;
  transition: var(--transition);
}

.auth-form .form-group input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.1);
}

.auth-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--secondary);
}

.form-link {
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-link:hover {
  color: var(--secondary-light);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-light);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.auth-footer a {
  color: var(--secondary);
  font-weight: 600;
}

.form-error {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 4px;
  display: none;
}

.form-success {
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  display: none;
  font-size: 0.9rem;
}

/* --- Dashboard Layout --- */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-light);
}

.dashboard-sidebar {
  width: 260px;
  background: var(--primary);
  color: white;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-logo {
  display: block;
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}

.sidebar-logo .logo-img {
  height: 38px;
  width: auto;
  filter: brightness(1.8) drop-shadow(0 1px 3px rgba(255,255,255,0.1));
}

.sidebar-logo span {
  color: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 4px;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.sidebar-nav a.active {
  background: rgba(99, 91, 255, 0.3);
  color: white;
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 16px 24px 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.sidebar-user:hover {
  background: rgba(255,255,255,0.05);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-info h4 {
  color: white;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin: 0;
}

/* Dashboard Main Content */
.dashboard-main {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-header h1 {
  font-size: 1.75rem;
}

.dashboard-header p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 4px;
}

.dashboard-actions {
  display: flex;
  gap: 12px;
}

/* Stats Cards */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.dash-stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.dash-stat-card:hover {
  box-shadow: var(--shadow-md);
}

.dash-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dash-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-stat-icon svg {
  width: 22px;
  height: 22px;
}

.dash-stat-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.dash-stat-badge.positive {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-dark);
}

.dash-stat-badge.neutral {
  background: rgba(99, 91, 255, 0.1);
  color: var(--secondary);
}

.dash-stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dash-stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Dashboard Cards */
.dash-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.dash-card-header h3 {
  font-size: 1.1rem;
}

.dash-card-body {
  padding: 24px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

/* Invoice Table */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.invoice-table td {
  padding: 16px;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.invoice-table tr:last-child td {
  border-bottom: none;
}

.invoice-table tr:hover td {
  background: var(--bg-light);
}

.status-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-paid {
  background: rgba(0, 212, 170, 0.1);
  color: #059669;
}

.status-pending {
  background: rgba(251, 191, 36, 0.1);
  color: #d97706;
}

.status-overdue {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.status-processing {
  background: rgba(99, 91, 255, 0.1);
  color: var(--secondary);
}

/* Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.activity-text strong {
  color: var(--text-primary);
}

.activity-time {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Support Form */
.support-tickets {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.support-ticket {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  gap: 16px;
}

.support-ticket:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.ticket-info h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.ticket-info p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0;
}

.ticket-meta {
  text-align: right;
  white-space: nowrap;
}

.ticket-meta .ticket-id {
  font-size: 0.8rem;
  color: var(--text-light);
  display: block;
  margin-bottom: 4px;
}

/* Payment Method Cards */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.payment-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.payment-card:hover,
.payment-card.selected {
  border-color: var(--secondary);
  background: rgba(99, 91, 255, 0.03);
}

.payment-card-icon {
  width: 48px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: white;
}

.payment-card-info h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.payment-card-info p {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  padding: 36px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--border);
}

.modal h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.modal > p {
  color: var(--text-light);
  margin-bottom: 24px;
}

/* Alert Messages */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.3);
  color: #059669;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.alert-info {
  background: rgba(99, 91, 255, 0.1);
  border: 1px solid rgba(99, 91, 255, 0.3);
  color: var(--secondary);
}

/* Mobile sidebar toggle */
.sidebar-toggle-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 101;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dash-grid {
    grid-template-columns: 1fr;
  }
  
  .payment-methods {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .auth-left {
    display: none;
  }
  
  .auth-right {
    padding: 24px;
  }
  
  .auth-form .form-row {
    grid-template-columns: 1fr;
  }
  
  .dashboard-sidebar {
    transform: translateX(-100%);
  }
  
  .dashboard-sidebar.open {
    transform: translateX(0);
  }
  
  .dashboard-main {
    margin-left: 0;
    padding: 24px 16px;
  }
  
  .sidebar-toggle-btn {
    display: flex;
  }
  
  .dash-stats {
    grid-template-columns: 1fr;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .invoice-table {
    font-size: 0.85rem;
  }
  
  .invoice-table th,
  .invoice-table td {
    padding: 10px 8px;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  stroke: var(--border);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Notification dot */
.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  margin-left: 4px;
}

/* Quick action buttons in dashboard */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.quick-action:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-action-icon svg {
  width: 20px;
  height: 20px;
}

.quick-action-text h4 {
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.quick-action-text p {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0;
}

@media (max-width: 768px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }
}
