/* ─── Betagro Account Security Portal Styles (account.css) ─────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&family=Noto+Sans+Thai:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #5ba125;
  --primary-hover: #4e8c1e;
  --primary-light: #f0fdf4;
  --primary-border: rgba(91, 161, 37, 0.25);

  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-focus: #5ba125;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --success-light: #dcfce7;
  --info: #0284c7;
  --info-light: #e0f2fe;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --font-family: 'Google Sans', 'Noto Sans Thai', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: #f1f5f9;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.bg-landscape {
  background-color: #e7f4f8;
  background-image: url('public/04-green-landscape.svg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ─── Top Navbar ─────────────────────────────────────────────────────────── */
.top-navbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-brand img {
  height: 32px;
  width: auto;
}

.navbar-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.navbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.navbar-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-nav-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-pill);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.user-nav-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.btn-signout {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-signout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ─── Main Content Container ─────────────────────────────────────────────── */
.main-container {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.page-header p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ─── Dashboard Grid ─────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 24px;
  align-items: start;
}

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

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.card-header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-icon-bubble {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── Passkeys Section Specifics ─────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 12px rgba(91, 161, 37, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.passkey-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 18px;
}

.passkey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.passkey-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.passkey-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.passkey-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.passkey-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.passkey-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.passkey-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.btn-delete-passkey {
  background: transparent;
  border: 1px solid #fecaca;
  color: #ef4444;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-delete-passkey:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.passkey-empty {
  text-align: center;
  padding: 32px 20px;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  margin-top: 12px;
  margin-bottom: 18px;
}

.passkey-empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.passkey-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.passkey-empty-desc {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ─── Profile Info List ──────────────────────────────────────────────────── */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

.profile-avatar-lg {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.profile-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.profile-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.badge-office {
  background: #dbeafe;
  color: #1e40af;
}

.badge-worker {
  background: #dcfce7;
  color: #166534;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f8fafc;
}

.info-label {
  color: var(--text-muted);
}

.info-value {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

/* ─── Security Status Bar ────────────────────────────────────────────────── */
.security-score-card {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  color: #ffffff;
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 8px 20px -4px rgba(22, 101, 52, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.security-score-left h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.security-score-left p {
  font-size: 12px;
  opacity: 0.9;
}

.security-score-badge {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ─── Alert Toast ────────────────────────────────────────────────────────── */
.alert-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  z-index: 100;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-info {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #7dd3fc;
}

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

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.portal-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  background: rgba(255, 255, 255, 0.6);
}
