/* INSURA VAULT — Shared Components */

/* =================== SPLASH SCREEN =================== */
#splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-primary), var(--brand-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#splash-screen.fade-out { opacity: 0; visibility: hidden; }
.splash-content { text-align: center; animation: fadeIn 0.6s ease; }
.logo-icon-large { font-size: 64px; margin-bottom: 16px; filter: drop-shadow(0 4px 16px rgba(0,0,0,0.3)); }
.logo-text-large { font-size: 36px; font-weight: 800; letter-spacing: 2px; }
.logo-insura { color: #fff; }
.logo-vault { color: var(--brand-gold); }

/* =================== BRAND LOGO (image asset) =================== */
/* The logo art sits on a solid white ground, so on dark surfaces it is shown
   inside a white rounded panel/chip rather than floating. */
.brand-logo-full {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  margin: 0 auto 8px;
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.login-logo-img { max-width: 260px; }
.brand-logo-mark {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.header-logo .brand-logo-mark { width: 28px; height: 28px; border-radius: 7px; }
.sidebar-logo .brand-logo-mark { width: 32px; height: 32px; }
img.hero-shield {
  width: 54px;
  height: 54px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 5px;
  animation: pulse 3s ease-in-out infinite;
}
.splash-tagline { color: rgba(255,255,255,0.7); font-size: var(--text-base); margin-top: 8px; letter-spacing: 1px; }
.splash-loader { margin-top: 32px; width: 200px; height: 3px; background: rgba(255,255,255,0.15); border-radius: 2px; overflow: hidden; margin-inline: auto; }
.loader-bar { width: 40%; height: 100%; background: linear-gradient(90deg, var(--brand-gold), var(--brand-accent)); border-radius: 2px; animation: loaderSlide 1.5s ease-in-out infinite; }
@keyframes loaderSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* =================== LOGIN =================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, var(--brand-primary-dark) 0%, var(--brand-primary) 40%, #1a2350 100%);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(79,110,247,0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-screen::after {
  content: '';
  position: absolute;
  bottom: 30%;
  left: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-hero {
  flex: 0 0 auto;
  padding: 60px 24px 32px;
  text-align: center;
}
.login-logo-wrap { margin-bottom: 20px; }
.login-shield-anim { font-size: 56px; margin-bottom: 12px; animation: pulse 2s ease-in-out infinite; }
.login-title { color: #fff; font-size: 32px; font-weight: 800; letter-spacing: 1px; }
.login-title span { color: #fff; }
.login-title strong { color: var(--brand-gold); }
.login-subtitle { color: rgba(255,255,255,0.6); font-size: var(--text-base); margin-top: 4px; }

.login-features { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.feature-pill {
  padding: 6px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--border-radius-full);
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: var(--weight-medium);
  backdrop-filter: blur(8px);
}

.login-card {
  flex: 1;
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding: 32px 24px;
  animation: slideUp 0.5s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
}

.login-tabs { display: flex; gap: 4px; background: var(--neutral-100); border-radius: 10px; padding: 4px; margin-bottom: 24px; }
.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--neutral-500);
  transition: all var(--transition-base);
  background: transparent;
}
.login-tab.active {
  background: #fff;
  color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

.login-form { animation: fadeIn 0.3s ease; }

.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--neutral-200);
  border-radius: 10px;
  overflow: hidden;
  background: var(--neutral-50);
  transition: border-color var(--transition-base);
}
.phone-input-wrap:focus-within { border-color: var(--brand-accent); background: #fff; }
.phone-code {
  padding: 12px 12px 12px 14px;
  font-size: var(--text-base);
  color: var(--neutral-600);
  border-right: 1px solid var(--neutral-200);
  white-space: nowrap;
  font-weight: var(--weight-medium);
}
.phone-input-wrap .app-input { border: none; background: transparent; }
.phone-input-wrap .app-input:focus { box-shadow: none; }

.otp-input-wrap { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.otp-box {
  width: 50px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: var(--weight-bold);
  border: 2px solid var(--neutral-200);
  border-radius: 12px;
  background: var(--neutral-50);
  color: var(--neutral-800);
  outline: none;
  transition: all var(--transition-base);
}
.otp-box:focus { border-color: var(--brand-accent); background: #fff; box-shadow: 0 0 0 4px rgba(79,110,247,0.12); transform: scale(1.05); }
.otp-box.filled { border-color: var(--color-success); background: var(--color-success-light); }

.otp-header { text-align: center; margin-bottom: 16px; }
.otp-header p { color: var(--neutral-600); font-size: var(--text-sm); }

.otp-resend { text-align: center; margin-top: 16px; }
.otp-resend span { font-size: var(--text-sm); color: var(--neutral-500); }

.login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--neutral-400);
  margin-top: 12px;
}

.twofa-header { text-align: center; margin-bottom: 20px; }
.twofa-icon { font-size: 48px; margin-bottom: 8px; }
.twofa-header h3 { font-size: var(--text-xl); color: var(--neutral-800); }
.twofa-header p { color: var(--neutral-500); font-size: var(--text-sm); margin-top: 4px; }

/* =================== TOAST =================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-left: 4px solid;
}
.toast--success { border-color: var(--color-success); }
.toast--error { border-color: var(--color-danger); }
.toast--warning { border-color: var(--color-warning); }
.toast--info { border-color: var(--color-info); }
.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--neutral-400);
  font-size: 16px;
  padding: 2px;
}
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* =================== MODAL =================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-box {
  background: #fff;
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--neutral-200);
}
.modal-title { font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--neutral-800); }
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--neutral-100);
  color: var(--neutral-600);
  transition: all var(--transition-base);
  font-size: 16px;
}
.modal-close:hover { background: var(--neutral-200); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--neutral-200);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* =================== TABLES =================== */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  background: var(--neutral-50);
  color: var(--neutral-500);
  font-weight: var(--weight-semibold);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--neutral-200);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-100);
  color: var(--neutral-700);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(79,110,247,0.02); }
.data-table .cell-bold { font-weight: var(--weight-semibold); color: var(--neutral-800); }
.data-table .cell-muted { color: var(--neutral-500); font-size: 12px; }
.data-table .cell-actions { display: flex; gap: 6px; }
.data-table .cell-actions button {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: var(--weight-medium);
  border: 1px solid var(--neutral-200);
  background: #fff;
  color: var(--neutral-600);
  cursor: pointer;
  transition: all var(--transition-base);
}
.data-table .cell-actions button:hover { border-color: var(--brand-accent); color: var(--brand-accent); }

/* Table toolbar */
.table-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.toolbar-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: 1.5px solid var(--neutral-200);
  border-radius: 10px;
  font-size: var(--text-sm);
  background: #fff;
  outline: none;
  transition: border-color var(--transition-base);
}
.toolbar-search:focus { border-color: var(--brand-accent); }
.toolbar-filter {
  padding: 10px 14px;
  border: 1.5px solid var(--neutral-200);
  border-radius: 10px;
  font-size: var(--text-sm);
  background: #fff;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* Pagination */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
}
.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--neutral-200);
  border-radius: 6px;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--neutral-600);
  background: #fff;
  cursor: pointer;
  transition: all var(--transition-base);
}
.page-btn:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.page-btn.active { background: var(--brand-accent); color: #fff; border-color: var(--brand-accent); }
.page-info { font-size: 13px; color: var(--neutral-500); }
