/* ============================================
   Firma Electrónica — Polska Grupa Konsultingowa
   Mobile-first CSS | PGK Branding
   ============================================ */

/* ---------- CSS Variables (PGK Brand) ---------- */
:root {
  --primary: #102A43;
  --primary-light: #1E3A8A;
  --primary-hover: #1E40AF;
  --accent: #B4935D;
  --accent-hover: #8B7355;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --text: #1f2937;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition: all 0.2s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-light);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-group label i {
  margin-right: 4px;
  color: var(--text-light);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-white);
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 42, 67, 0.1);
}

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

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

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

@media (max-width: 600px) {
  .form-row-2col {
    grid-template-columns: 1fr;
  }
}

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  animation: slideIn 0.3s ease;
}

.alert-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-warning {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.alert-warning a {
  color: #92400e;
  font-weight: 600;
}

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

/* ---------- Cards ---------- */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h2 i {
  color: var(--primary);
}

.card-body {
  padding: 24px;
}

/* ---------- Tables ---------- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

.table th {
  font-weight: 600;
  color: var(--text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
}

.table tbody tr:hover {
  background: var(--border-light);
}

.signer-info {
  display: flex;
  flex-direction: column;
}

.signer-info strong {
  font-size: 14px;
}

.signer-info small {
  color: var(--text-muted);
  font-size: 12px;
}

.doc-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--info-bg);
  color: var(--info);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 4px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-pending {
  background: var(--warning-bg);
  color: #92400e;
}

.badge-signed {
  background: var(--success-bg);
  color: #065f46;
}

.badge-expired {
  background: var(--border-light);
  color: var(--text-light);
}

.badge-revoked {
  background: var(--danger-bg);
  color: #991b1b;
}

.badge-action {
  font-size: 11px;
  padding: 3px 8px;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 20px 0 8px;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.page-link:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.page-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #102A43 0%, #1E3A8A 50%, #102A43 100%);
}

.login-card {
  background: var(--bg-white);
  padding: 40px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo {
  width: 120px;
  height: auto;
  margin: 0 auto 20px;
  display: block;
}

.login-logo img {
  width: 100%;
  height: auto;
}

.login-card h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.login-form {
  text-align: left;
}

.login-form .form-group {
  margin-bottom: 20px;
}

/* ============================================
   ADMIN LAYOUT
   ============================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 24px;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
  font-size: 24px;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  transition: var(--transition);
  text-decoration: none;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-right: 3px solid #B4935D;
}

.nav-logout {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Admin Main */
.admin-main {
  flex: 1;
  margin-left: 250px;
  padding: 32px;
  max-width: 1200px;
}

.admin-header {
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-header h1 i {
  color: var(--primary);
}

.header-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.total { background: var(--info-bg); color: var(--info); }
.stat-icon.pending { background: var(--warning-bg); color: var(--warning); }
.stat-icon.signed { background: var(--success-bg); color: var(--success); }
.stat-icon.expired { background: var(--danger-bg); color: var(--danger); }

.stat-number {
  font-size: 28px;
  font-weight: 700;
  display: block;
  line-height: 1;
}

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

/* Filters */
.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-form input,
.filter-form select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
}

.filter-form input {
  width: 180px;
}

/* Create form */
.form-inline-create .form-row {
  align-items: flex-end;
}

.form-group-btn {
  padding-bottom: 16px;
}

/* Documents grid */
.documents-grid {
  display: grid;
  gap: 12px;
}

.document-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.document-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.document-icon {
  width: 48px;
  height: 48px;
  background: #fef2f2;
  color: var(--danger);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.document-info {
  flex: 1;
  min-width: 0;
}

.document-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.document-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.document-meta,
.document-hash {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.document-hash {
  font-family: monospace;
}

/* Config status */
.config-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.config-ok {
  background: var(--success-bg);
  color: #065f46;
}

.config-warning {
  background: var(--warning-bg);
  color: #92400e;
}

.config-info {
  margin-top: 16px;
}

.config-info pre {
  background: var(--bg);
  padding: 14px;
  border-radius: var(--radius);
  font-size: 13px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

/* File upload */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(16, 42, 67, 0.03);
}

.file-upload-area i {
  font-size: 36px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.file-upload-area p {
  color: var(--text-light);
  font-size: 14px;
}

.file-upload-area input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  cursor: pointer;
}

.file-name {
  display: block;
  margin-top: 8px;
  font-weight: 600;
  color: var(--primary);
  font-size: 14px;
}

/* ============================================
   SIGNING FLOW
   ============================================ */
.sign-page {
  min-height: 100vh;
  background: var(--bg);
}

.sign-header {
  background: var(--primary);
  color: #fff;
  padding: 16px 24px;
  box-shadow: var(--shadow-md);
}

.sign-header-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sign-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
}

.sign-doc-name {
  font-size: 13px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Progress Bar */
.progress-bar {
  background: var(--bg-white);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.progress-steps {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  background: var(--border);
  color: var(--text-muted);
  transition: var(--transition);
}

.progress-step.active .step-circle {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(16, 42, 67, 0.15);
}

.progress-step.completed .step-circle {
  background: var(--success);
  color: #fff;
}

.progress-step span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.progress-step.active span {
  color: var(--primary);
  font-weight: 600;
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  margin-bottom: 20px;
  transition: var(--transition);
  min-width: 24px;
  max-width: 60px;
}

.progress-line.active {
  background: var(--success);
}

/* Sign Content */
.sign-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
}

.step-panel {
  animation: fadeIn 0.3s ease;
}

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

.step-title {
  margin-bottom: 24px;
}

.step-title h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-title h2 i {
  color: var(--primary);
}

.step-title p {
  color: var(--text-light);
  font-size: 15px;
}

/* PDF Viewer */
.pdf-viewer-container {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.pdf-viewer {
  width: 100%;
  height: 500px;
  border: none;
}

@media (max-width: 600px) {
  .pdf-viewer {
    height: 350px;
  }
}

/* Step Footer */
.step-footer {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.step-footer-between {
  flex-direction: row;
  justify-content: space-between;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
  padding: 14px 18px;
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  width: 100%;
}

.checkbox-label:hover {
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Signature Area */
.signature-area {
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  height: 250px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.signature-area canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.signature-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  pointer-events: none;
}

.signature-placeholder i {
  font-size: 36px;
}

.signature-placeholder span {
  font-size: 16px;
}

.signature-actions {
  margin-top: 12px;
  text-align: center;
}

/* Sign Form */
.sign-form {
  background: var(--bg-white);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* Confirmation */
.confirm-summary {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.confirm-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.confirm-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.confirm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 14px;
}

@media (max-width: 500px) {
  .confirm-grid {
    grid-template-columns: 1fr;
  }
}

.confirm-signature {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.confirm-signature img {
  max-width: 300px;
  max-height: 120px;
}

.confirm-legal {
  padding: 16px 24px;
  background: var(--info-bg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #1e40af;
}

.confirm-legal i {
  font-size: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  background: var(--bg-white);
  padding: 40px;
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-spinner p {
  font-weight: 600;
  margin-bottom: 4px;
}

.loading-spinner small {
  color: var(--text-muted);
}

/* ============================================
   SUCCESS PAGE
   ============================================ */
.success-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
}

.success-card {
  background: var(--bg-white);
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.success-icon {
  font-size: 64px;
  color: var(--success);
  margin-bottom: 16px;
}

.success-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.success-subtitle {
  color: var(--text-light);
  font-size: 15px;
  margin-bottom: 28px;
}

.success-details {
  text-align: left;
  background: var(--bg);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

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

.detail-row i {
  color: var(--success);
  font-size: 16px;
  flex-shrink: 0;
}

.success-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

/* ============================================
   ERROR PAGE
   ============================================ */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.error-card {
  background: var(--bg-white);
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.error-icon {
  font-size: 56px;
  color: var(--warning);
  margin-bottom: 16px;
}

.sign-error-icon {
  color: var(--danger);
}

.error-card h1 {
  font-size: 24px;
  margin-bottom: 12px;
}

.error-card p {
  color: var(--text-light);
  font-size: 15px;
  margin-bottom: 24px;
}

.error-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.error-contact {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .admin-main {
    margin-left: 0;
    padding: 16px;
  }

  .admin-header h1 {
    font-size: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-number {
    font-size: 22px;
  }

  .form-inline-create .form-row {
    flex-direction: column;
  }

  .form-inline-create .form-row .form-group {
    min-width: 100%;
  }

  .filters-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-form {
    width: 100%;
  }

  .filter-form input {
    flex: 1;
    min-width: 0;
  }

  /* Mobile sidebar as top bar */
  .admin-layout::before {
    content: '';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #102A43;
    z-index: 100;
  }

  .admin-main {
    padding-top: 72px;
  }
}

@media (max-width: 480px) {
  .sign-content {
    padding: 16px;
  }

  .step-title h2 {
    font-size: 18px;
  }

  .confirm-summary .confirm-section {
    padding: 16px;
  }

  .login-card {
    padding: 28px 24px;
  }

  .success-card,
  .error-card {
    padding: 32px 24px;
  }

  .progress-step span {
    display: none;
  }

  .progress-steps {
    gap: 4px;
  }

  .otp-input {
    font-size: 24px !important;
    letter-spacing: 6px !important;
  }
}

/* ---------- OTP Verification Styles ---------- */

.otp-container {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.otp-info {
  background: var(--info-bg);
  border: 1px solid #93c5fd;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.otp-info i {
  font-size: 48px;
  color: var(--info);
  display: block;
  margin-bottom: 12px;
}

.otp-info p {
  color: var(--text);
  font-size: 15px;
  margin: 0;
}

.otp-input-group {
  margin-bottom: 20px;
  text-align: left;
}

.otp-input-group label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 14px;
}

.otp-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 28px;
  font-family: monospace;
  letter-spacing: 10px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  outline: none;
  transition: var(--transition);
  background: var(--bg-white);
}

.otp-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.otp-hint {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
}

.otp-message {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.otp-message i {
  font-size: 18px;
  flex-shrink: 0;
}

.otp-message-success {
  background: var(--success-bg);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.otp-message-error {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.otp-message-info {
  background: var(--info-bg);
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.otp-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.otp-actions .btn {
  flex: 1;
  min-width: 180px;
}

.otp-verified-badge {
  background: var(--success-bg);
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: fadeInScale 0.3s ease;
}

.otp-verified-badge i {
  font-size: 32px;
  color: var(--success);
}

.otp-verified-badge span {
  font-size: 18px;
  font-weight: 600;
  color: #065f46;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---------- Verification Badge Styles ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: var(--success-bg);
  color: #065f46;
}

.badge-info {
  background: var(--info-bg);
  color: #1e40af;
}

.confirm-verification .confirm-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirm-verification .confirm-grid div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
