/* Licențe EAM - Modern glass UX foundation */
:root {
  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-glass: #ffffff;
  --primary: rgb(4, 92, 140);
  --primary-hover: rgb(3, 78, 118);
  --primary-light: rgba(4, 92, 140, 0.12);
  --accent: rgb(4, 92, 140);
  --text: #102a43;
  --text-muted: #486581;
  --border: #d9e2ec;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px -4px rgb(16 42 67 / 0.22);
  --shadow-lg: 0 10px 28px -14px rgb(16 42 67 / 0.3);
  --focus-ring: 0 0 0 3px rgba(4, 92, 140, 0.22);
  --status-pending-bg: #fef3c7;
  --status-accepted-bg: #d1fae5;
  --status-rejected-bg: #fee2e2;
}

* { box-sizing: border-box; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

/* Shared top shell */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0.75rem 0;
}
.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.app-header .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.app-header .nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.app-header .nav-links > a,
.app-header .nav-links > button,
.app-header .nav-links > span,
.app-header .nav-links > .notif-wrap > button {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  border: none;
  background: transparent;
}
.app-header .nav-links > a:hover,
.app-header .nav-links > button:hover,
.app-header .nav-links > .notif-wrap > button:hover,
.app-header .nav-links > .active {
  background: var(--primary-light);
  color: var(--primary);
}
.app-header .nav-links .user-info {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.25rem;
}
.app-header .nav-links .logout {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

/* Notifications */
.notif-wrap { position: relative; }
.notif-trigger {
  position: relative;
  cursor: pointer;
}
.notif-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.notif-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: none;
  overflow: hidden;
  z-index: 200;
}
.notif-menu.open { display: block; }
.notif-head {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.notif-item {
  display: block;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #edf2fb;
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8faff; }
.notif-item small { color: var(--text-muted); display: block; }
.notif-menu .notif-item,
.notif-menu .notif-item:hover {
  color: var(--text);
}

/* Cards */
.app-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  backdrop-filter: none;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.app-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: #cddaf8;
}
.app-card .card-header {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.app-card .card-body { padding: 1.25rem; }

/* KPI + helper components */
.kpi-tile {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.85rem 1rem;
}
.kpi-tile .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-weight: 600;
}
.kpi-tile .value {
  font-size: 1.45rem;
  line-height: 1.1;
  font-weight: 700;
}
.help-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  border-radius: 999px;
  border: 1px solid #bcccdc;
  color: var(--primary);
  background: #f0f4f8;
  padding: 0.22rem 0.62rem;
}
.inline-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.step-card {
  border: 1px dashed #bcccdc;
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.75rem;
}
.empty-state-action {
  margin-top: 0.75rem;
  display: inline-flex;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-pending { background: var(--status-pending-bg); color: #b45309; }
.status-accepted { background: var(--status-accepted-bg); color: #047857; }
.status-rejected { background: var(--status-rejected-bg); color: #b91c1c; }

/* Request cards */
.request-card {
  background: var(--bg-card-solid);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  margin-bottom: 1rem;
}
.request-card .request-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.request-card .request-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.request-card .request-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid #e8edf8;
}
.request-card .request-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn-app {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn-app-primary { background: var(--primary); color: #fff; }
.btn-app-primary:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); }
.btn-app-success { background: #059669; color: #fff; }
.btn-app-success:hover { background: #047857; color: #fff; }
.btn-app-outline-danger { background: transparent; color: #dc2626; border: 2px solid #dc2626; }
.btn-app-outline-danger:hover { background: #dc2626; color: #fff; }
.btn-app-outline-primary {
  background: #fff;
  color: var(--primary);
  border: 1px solid #9fb3c8;
}
.btn-app-outline-primary:hover {
  background: #f0f4f8;
  color: var(--primary-hover);
}
.btn-app.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: #f8fafc;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-glass);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  backdrop-filter: none;
  padding: 2rem;
}
.auth-card h1 {
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.45rem;
}
.auth-subtitle {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.35rem;
}
.auth-card .auth-footer {
  text-align: center;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid #e5ebf8;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-card .auth-footer a { font-weight: 500; }

/* Layout and page intro */
.app-page { padding: 1.5rem 0 3rem; }
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 1rem;
}

/* Wizard */
.wizard-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.wizard-step {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
  font-size: 0.9rem;
  background: #d9e2ec;
  color: var(--text-muted);
}
.wizard-step.active { background: var(--primary); color: #fff; }
.wizard-step.done { background: var(--status-accepted-bg); color: #047857; }

/* Alerts */
.alert-app {
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
  border: none;
}
.alert-app.alert-success { background: var(--status-accepted-bg); color: #065f46; }
.alert-app.alert-danger { background: var(--status-rejected-bg); color: #991b1b; }
.alert-app.alert-info { background: #e0f2fe; color: #075985; }

/* Tables */
.app-card .table { margin-bottom: 0; }
.app-card .table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.app-card .table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #e4ebf3;
}
.app-card .table tbody tr:last-child td { border-bottom: none; }
.app-card .table tbody tr:hover { background: #f8fafc; }

/* Forms */
.form-card .form-label { font-weight: 500; color: var(--text); }
.form-card .form-select,
.form-card .form-control {
  border-radius: var(--radius-sm);
  border: 1px solid #bcccdc;
}
.form-card .form-select:focus,
.form-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.form-control:focus, .form-select:focus, button:focus-visible, a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Tooltips and tour */
.help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #9fb3c8;
  background: #f0f4f8;
  color: var(--primary);
  font-size: 0.72rem;
  margin-left: 0.35rem;
  cursor: help;
}
.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  z-index: 300;
  display: none;
}
.tour-overlay.open { display: block; }
.tour-popover {
  position: fixed;
  z-index: 301;
  max-width: min(340px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.9rem;
}
.tour-popover .title {
  font-weight: 700;
  font-size: 0.94rem;
  margin-bottom: 0.35rem;
}
.tour-popover .desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2.2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Footer institutional */
.app-footer {
  margin-top: 2rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  background: #fff;
}
.app-footer .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 0.55rem 0.9rem;
}
.app-footer .footer-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.app-footer .footer-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1px;
}
.app-footer .footer-meta strong {
  color: var(--primary);
  font-weight: 700;
}
.app-footer .footer-note {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #7b8794;
}
.app-footer .footer-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  padding-left: 0.4rem;
}
.app-footer .footer-logo {
  display: block;
  width: 88px;
  height: auto;
  max-height: 30px;
  max-width: 100%;
  image-rendering: -webkit-optimize-contrast;
}

/* Prevent accidental oversized logos/images in footer */
.app-footer img.footer-logo {
  width: 88px !important;
  height: auto !important;
  max-height: 30px !important;
  object-fit: contain !important;
}

/* Teme ocupate */
.topic-taken { text-decoration: line-through; color: var(--text-muted); }
.topic-taken .badge { text-decoration: none; }

/* Responsive and accessibility */
@media (max-width: 768px) {
  .app-header { padding: 0.6rem 0; }
  .app-header .container { align-items: flex-start; gap: 0.55rem; }
  .app-header .brand { font-size: 1.05rem; }
  .app-header .nav-links {
    width: 100%;
    gap: 0.35rem;
  }
  .app-header .nav-links > .user-info {
    width: 100%;
    margin-right: 0;
    padding: 0.1rem 0;
    font-size: 0.82rem;
  }
  .app-header .nav-links > a,
  .app-header .nav-links > button,
  .app-header .nav-links > span,
  .app-header .nav-links > .notif-wrap > button {
    font-size: 0.82rem;
    padding: 0.4rem 0.62rem;
  }
  .notif-wrap { position: static; }
  .notif-menu {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: 84px;
    width: auto;
    max-height: 56vh;
    overflow-y: auto;
    z-index: 600;
    border-radius: 12px;
  }
  .page-title { font-size: 1.25rem; }
  .app-card .card-body { padding: 1rem; }
  .request-card { padding: 0.9rem; }
  .app-footer .footer-inner { justify-content: center; text-align: center; }
  .app-footer .footer-logo-link { padding-left: 0; }
  .app-footer .footer-logo { width: 80px; }
  .app-footer img.footer-logo { width: 80px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
