.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(160deg, #ede9fe 0%, #e0f2fe 50%, #f8fafc 100%);
}

.auth-card {
  width: min(100%, 420px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(91, 33, 182, 0.12);
  padding: 1.75rem 1.5rem;
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: #4c1d95;
}

.auth-card .auth-sub {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  color: #64748b;
}

.auth-field {
  margin-bottom: 0.85rem;
}

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.3rem;
}

.auth-field input,
.auth-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font: inherit;
}

.auth-row {
  display: flex;
  gap: 0.5rem;
}

.auth-row input {
  flex: 1;
}

.auth-msg {
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
  color: #64748b;
}

.auth-msg.is-error {
  color: #b91c1c;
}

.auth-msg.is-ok {
  color: #15803d;
}

.auth-dev-code {
  margin-top: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #92400e;
}

.auth-profile-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #e2e8f0;
}

.auth-actions {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-user-pill {
  font-size: 0.82rem;
  color: #5b21b6;
  font-weight: 600;
  margin-right: 0.5rem;
}

.auth-link {
  font-size: 0.82rem;
  color: #2563eb;
  margin-right: 0.65rem;
  text-decoration: none;
}

.auth-logout-btn {
  border: none;
  background: none;
  color: #64748b;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
}

.header-auth-slot {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  position: relative;
}

.header-user-menu {
  position: relative;
}

.header-user-trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.55rem 0.28rem 0.35rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.header-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d4f8b 0%, #0d9488 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 5.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 168px;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  z-index: 80;
}

.header-user-dropdown[hidden] {
  display: none !important;
}

.header-user-drop-link,
.header-user-drop-logout {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border: none;
  border-radius: 8px;
  background: none;
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
}

.header-user-drop-link:hover,
.header-user-drop-logout:hover {
  background: #f1f5f9;
}

.portal-hero {
  padding: 2rem 0 1rem;
}

.portal-search {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.portal-search input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  font: inherit;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.portal-card {
  background: #fff;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}

.portal-card:hover {
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
  transform: translateY(-2px);
}

.portal-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: #5b21b6;
}

.portal-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.portal-results {
  margin-top: 1rem;
}

.portal-result-group {
  margin-bottom: 1.25rem;
}

.portal-result-group h3 {
  font-size: 0.95rem;
  color: #5b21b6;
  margin: 0 0 0.5rem;
}

.portal-result-item {
  display: block;
  padding: 0.65rem 0.75rem;
  background: #faf5ff;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid #ede9fe;
}

.portal-result-item:hover {
  border-color: #c4b5fd;
}

.portal-result-item strong {
  display: block;
  color: #1e293b;
}

.portal-result-item span {
  font-size: 0.8rem;
  color: #64748b;
}

.portal-profile {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
}

.portal-profile .auth-field {
  max-width: 360px;
}
