/* =============================================================================
   SYGA HRM - auth.css
   =============================================================================
   Styles pour : login, changement mdp, lock screen, user dropdown
   Maquette reference : 01-login.html
   ============================================================================= */

/* --- Auth Container (full screen centered) --- */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  background: #f8fafc;
}

/* Subtle background blobs */
.auth-container::before,
.auth-container::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  filter: blur(60px);
  pointer-events: none;
}

.auth-container::before {
  width: 16rem;
  height: 16rem;
  background: #4FA8D6;
  top: 2.5rem;
  left: 2.5rem;
}

.auth-container::after {
  width: 24rem;
  height: 24rem;
  background: #4FA8D6;
  bottom: 5rem;
  right: 5rem;
}

/* --- Auth Card (white centered box) --- */
.auth-card {
  width: 100%;
  max-width: 28rem;
  background: #fff;
  border-radius: 1rem;
  padding: 2.5rem;
  position: relative;
  z-index: 10;
  border: 1px solid #f1f5f9;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* --- Logo --- */
.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.auth-logo {
  width: 12rem;
  height: auto;
  object-fit: contain;
}

/* --- Header --- */
.auth-header {
  margin-bottom: 2rem;
}

.auth-header h2 {
  font-family: 'Poppins', sans-serif;
  color: #1B3A5F;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.auth-header p {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

/* --- Form --- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* --- Field --- */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-field label {
  display: block;
  color: #1B3A5F;
  font-weight: 500;
  font-size: 0.875rem;
}

/* --- Input Wrapper (icon + input) --- */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 1rem;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.auth-input-icon i {
  font-size: 1.125rem;
  color: #9ca3af;
}

.auth-input-wrap input[type="text"],
.auth-input-wrap input[type="password"],
.auth-input-wrap input[type="email"] {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-family: 'Inter', sans-serif;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

/* Password field: extra padding right for toggle button */
.auth-input-wrap--password input {
  padding-right: 3rem !important;
}

.auth-input-wrap input:focus {
  border-color: #4FA8D6;
  box-shadow: 0 0 0 3px rgba(79, 168, 214, 0.15);
}

.auth-input-wrap input::placeholder {
  color: #9ca3af;
}

/* --- Toggle Password Button --- */
.auth-toggle-password {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
}

.auth-toggle-password i {
  font-size: 1.125rem;
  color: #9ca3af;
  transition: color 0.2s;
}

.auth-toggle-password:hover i {
  color: #1B3A5F;
}

/* --- Remember Me --- */
.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #1B3A5F;
  cursor: pointer;
}

.auth-remember label {
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

/* --- Error Message --- */
.auth-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  color: #dc2626;
  font-size: 0.85rem;
  animation: authShake 0.3s ease;
}

.auth-error i {
  flex-shrink: 0;
  font-size: 1rem;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* --- Submit Button --- */
.auth-submit {
  width: 100%;
  padding: 0.875rem;
  background: #1B3A5F;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  margin-top: 0.25rem;
}

.auth-submit:hover {
  background: #2E6B8A;
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
}

/* --- Footer --- */
.auth-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.auth-footer p {
  text-align: center;
  color: #9ca3af;
  font-size: 0.75rem;
  margin: 0;
}

/* =============================================================================
   CHANGE PASSWORD SCREEN
   ============================================================================= */

.auth-change-password .auth-header {
  text-align: center;
}

.auth-change-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2E6B8A, #1B3A5F);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.auth-change-icon i {
  font-size: 1.5rem;
  color: #fff;
}

/* --- Password Strength Bars --- */
.auth-password-strength {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.auth-password-strength-bar {
  flex: 1;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  transition: background-color 0.3s;
}

.auth-password-hint {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.375rem;
}

/* =============================================================================
   LOCK SCREEN OVERLAY
   ============================================================================= */

#syga-lock-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lockFadeIn 0.3s ease;
}

@keyframes lockFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-lock-fade-out {
  animation: lockFadeOut 0.3s ease forwards !important;
}

@keyframes lockFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.auth-lock-screen {
  background: #fff;
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 24rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-lock-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.auth-lock-icon i {
  font-size: 1.75rem;
  color: #fff;
}

.auth-lock-screen h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 0.5rem;
}

.auth-lock-screen p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0 0 0.25rem;
}

.auth-lock-hint {
  font-size: 0.8rem !important;
  color: #94a3b8 !important;
  margin-bottom: 1.25rem !important;
}

.auth-lock-form {
  margin-top: 1.25rem;
}

.auth-lock-form .auth-input-wrap {
  margin-bottom: 1rem;
}

.auth-lock-form .auth-input-wrap input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-lock-form .auth-input-wrap input:focus {
  border-color: #4FA8D6;
  box-shadow: 0 0 0 3px rgba(79, 168, 214, 0.15);
}

.auth-lock-form .auth-submit {
  width: 100%;
}

#syga-lock-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

#syga-lock-error i {
  flex-shrink: 0;
}

/* =============================================================================
   USER DROPDOWN MENU
   ============================================================================= */

.syga-user-dropdown {
  position: relative;
}

.syga-user-avatar {
  cursor: pointer;
  user-select: none;
}

.syga-user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  min-width: 12rem;
  padding: 0.375rem 0;
  z-index: 1000;
  border: 1px solid #e2e8f0;
}

.syga-user-menu--open {
  display: block;
  animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.syga-user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1rem;
  color: #334155;
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.syga-user-menu-item:hover {
  background: #f1f5f9;
  color: #1e293b;
  text-decoration: none;
}

.syga-user-menu-item i {
  font-size: 1rem;
  color: #64748b;
}

.syga-user-menu-logout {
  color: #dc2626;
}

.syga-user-menu-logout:hover {
  background: #fef2f2;
  color: #dc2626;
}

.syga-user-menu-logout i {
  color: #dc2626;
}

.syga-user-menu-divider {
  margin: 0.25rem 0;
  border: none;
  border-top: 1px solid #e2e8f0;
}
/* =============================================================================
   PROFILE PAGE
   ============================================================================= */

.syga-profile-container {
  max-width: 56rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Tabs */
.syga-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1rem;
}

.syga-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.syga-tab:hover {
  color: #1B3A5F;
}

.syga-tab--active {
  color: #1B3A5F;
  border-bottom-color: #1B3A5F;
}

.syga-tab i {
  font-size: 1rem;
}

/* Profile cards */
.syga-profile-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.syga-profile-body {
  padding: 1.5rem;
}

.syga-section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1B3A5F;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.syga-section-title i {
  color: #2E6B8A;
}

/* Profile header (avatar + name) */
.syga-profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.syga-profile-avatar-large {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2E6B8A, #1B3A5F);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid #4FA8D6;
}

.syga-profile-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.syga-profile-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1B3A5F;
  margin: 0;
}

.syga-profile-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.syga-badge-role {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #1B3A5F;
  color: #fff;
}

.syga-profile-entity {
  font-size: 0.85rem;
  color: #64748b;
}

.syga-profile-username {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Form grid */
.syga-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.syga-form-grid--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.syga-form-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.syga-form-field .form-group {
  margin-bottom: 0;
}

.syga-form-field .form-group > label.control-label {
  display: none;
}

.syga-form-field .form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.syga-form-field .form-control:focus {
  border-color: #4FA8D6;
  box-shadow: 0 0 0 2px rgba(79, 168, 214, 0.15);
  outline: none;
}

.syga-input-readonly {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

/* Form hint */
.syga-form-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.syga-form-hint i {
  color: #4FA8D6;
}

/* Form actions */
.syga-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.syga-btn-accent {
  background: #E67E22 !important;
  color: #fff !important;
  border: none !important;
}

.syga-btn-accent:hover {
  background: #d35400 !important;
}

/* Logs table */
.syga-logs-table .syga-table {
  width: 100%;
}

.syga-logs-table .syga-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.syga-logs-table .syga-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  color: #334155;
}

.syga-log-icon-green { color: #16a34a; font-size: 1.125rem; }
.syga-log-icon-blue  { color: #2563eb; font-size: 1.125rem; }
.syga-log-icon-gray  { color: #94a3b8; font-size: 1.125rem; }

.syga-badge-active {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.625rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: #dcfce7;
  color: #16a34a;
}

/* Responsive */
@media (max-width: 768px) {
  .syga-profile-header { flex-direction: column; text-align: center; }
  .syga-form-grid,
  .syga-form-grid--3 { grid-template-columns: 1fr; }
  .syga-tabs { overflow-x: auto; }
}

/* =============================================================================
   AUDIT LOGS
   ============================================================================= */

/* Filters bar */
.syga-logs-filters {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.syga-logs-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.syga-logs-filter-group > label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.syga-logs-filter-group .form-group {
  margin-bottom: 0;
}

.syga-logs-filter-group .form-group > label {
  display: none;
}

.syga-logs-filter-group .form-control {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  border-radius: 0.375rem;
}

.syga-logs-filter-count {
  margin-left: auto;
  font-size: 0.8125rem;
  color: #64748b;
  font-weight: 500;
  padding-bottom: 0.375rem;
}

/* Table compact */
.syga-table-compact th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  font-weight: 600;
  padding: 0.5rem 0.625rem;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.syga-table-compact td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8125rem;
  color: #334155;
  vertical-align: middle;
}

.syga-table-compact tbody tr:hover {
  background: #f8fafc;
}

.syga-logs-td-icon {
  width: 2rem;
  text-align: center;
}

.syga-logs-td-icon i {
  font-size: 1rem;
}

.syga-logs-td-event {
  min-width: 10rem;
}

.syga-log-event-label {
  font-weight: 500;
  color: #1e293b;
}

.syga-log-event-detail {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.125rem;
  font-family: monospace;
}

.syga-logs-td-category { white-space: nowrap; }
.syga-logs-td-severity { white-space: nowrap; }
.syga-logs-td-ip       { font-family: monospace; font-size: 0.75rem; color: #94a3b8; }
.syga-logs-td-date     { white-space: nowrap; font-size: 0.8rem; color: #64748b; }

.syga-logs-table-wrap {
  overflow-x: auto;
}

/* Severity colors */
.syga-sev-info     { color: #2563eb; }
.syga-sev-warning  { color: #d97706; }
.syga-sev-error    { color: #dc2626; }
.syga-sev-critical { color: #7c2d12; }

/* Severity badges */
.syga-sev-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.syga-sev-badge.syga-sev-info     { background: #dbeafe; color: #1d4ed8; }
.syga-sev-badge.syga-sev-warning  { background: #fef3c7; color: #b45309; }
.syga-sev-badge.syga-sev-error    { background: #fee2e2; color: #dc2626; }
.syga-sev-badge.syga-sev-critical { background: #fecaca; color: #7f1d1d; }

/* Category badges */
.syga-cat-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
}

.syga-cat-auth     { background: #e0e7ff; color: #3730a3; }
.syga-cat-pipeline { background: #d1fae5; color: #065f46; }
.syga-cat-pointage { background: #fef3c7; color: #92400e; }
.syga-cat-admin    { background: #f3e8ff; color: #6b21a8; }
.syga-cat-other    { background: #f1f5f9; color: #475569; }

/* Pagination */
.syga-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0 0;
  border-top: 1px solid #f1f5f9;
  margin-top: 0.5rem;
}

.syga-pagination-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #2E6B8A;
  cursor: pointer;
  text-decoration: none;
}

.syga-pagination-link:hover {
  color: #1B3A5F;
  text-decoration: none;
}

.syga-pagination-info {
  font-size: 0.8125rem;
  color: #94a3b8;
}

/* Empty state */
.syga-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

.syga-empty-state i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

.syga-empty-state p {
  font-size: 0.9375rem;
  margin: 0;
}
