
/* ===== Auth pages (register / login) ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}
.auth-wrap {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}
.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.auth-card h1 {
  margin: 0 0 24px;
  font-size: 24px;
  text-align: center;
}
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.auth-card input {
  padding: 12px 16px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  font-size: 15px;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--brand, #b91c1c);
}
.auth-card button {
  margin-top: 8px;
}
.auth-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.auth-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.auth-link {
  text-align: center;
  margin: 12px 0 0;
  font-size: 13px;
}
.auth-link a {
  color: var(--brand, #b91c1c);
  text-decoration: none;
  font-weight: 600;
}
.auth-link a:hover { text-decoration: underline; }
.pgs-hp { position: absolute; left: -9999px; }

/* Auth links in header */
.sp-auth-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}
.sp-auth-btn {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line, #e2e8f0);
  color: var(--ink, #0b1220);
  transition: all .15s;
}
.sp-auth-btn:hover { background: #f1f5f9; }
.sp-auth-login {
  background: var(--brand, #b91c1c);
  color: #fff;
  border-color: var(--brand, #b91c1c);
}
.sp-auth-login:hover { opacity: 0.9; }
.sp-auth-logout {
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.sp-auth-form { display: inline; margin: 0; }
@media (max-width: 768px) {
  .sp-auth-links { display: none; }
}

/* Auth button � match site style */
.auth-card button,
.auth-card .pgs-btn {
  width: 100%;
  padding: 13px 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
}
.auth-card button[type="submit"],
.auth-card .pgs-btn-primary {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  color: #fff;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}
.auth-card button[type="submit"]:hover,
.auth-card .pgs-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(185, 28, 28, 0.4);
}
.auth-card button[type="submit"]:active {
  transform: translateY(0);
}

/* Header auth links � clean style */
.sp-auth-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
}
.sp-auth-btn {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all .2s;
  line-height: 1.2;
  font-family: inherit;
}
.sp-auth-btn:hover { opacity: 0.85; text-decoration: none !important; }
.sp-auth-login {
  background: linear-gradient(135deg, #0345BF, #2bb8d4);
}
.sp-auth-logout {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
}
.sp-auth-logout:hover { background: rgba(255,255,255,0.25); }
.sp-auth-form { display: inline; margin: 0; }

/* ===== Front auth dropdown (user icon) ===== */
.sp-auth-menu {
  position: relative;
  margin-left: 16px;
}
.sp-auth-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none !important;
  font-family: inherit;
}
.sp-auth-trigger:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none !important;
}
.sp-auth-trigger svg {
  flex-shrink: 0;
  opacity: 0.9;
}
.sp-auth-trigger-link {
  background: linear-gradient(135deg, #0345BF, #2bb8d4);
  border-color: transparent;
  color: #fff;
}
.sp-auth-trigger-link:hover {
  opacity: 0.9;
}
.sp-auth-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px;
  padding: 6px;
  z-index: 500;
}
.sp-auth-dropdown[hidden] { display: none !important; }
.sp-auth-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: #0b1220;
  text-align: left;
  text-decoration: none !important;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
  font-family: inherit;
}
.sp-auth-item:hover {
  background: #f1f5f9;
  text-decoration: none !important;
}
.sp-auth-item-danger {
  color: var(--ink, #0b1220);
}
.sp-auth-item-danger:hover {
  background: #f1f5f9;
}
.sp-auth-sep {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 8px;
}
.sp-auth-dropdown form {
  margin: 0;
  padding: 0;
}

.sp-auth-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.sp-auth-trigger svg {
  width: 36px;
  height: 36px;
}
.sp-auth-user {
  padding: 10px 14px 6px;
}
.sp-auth-user strong {
  font-size: 13px;
  display: block;
}
.sp-auth-trigger {
  padding: 6px;
  width: 48px;
  height: 48px;
  justify-content: center;
}

/* Fix dropdown overflow + button styles */
.sp-auth-dropdown {
  overflow: hidden;
}
.sp-auth-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-auth-dropdown form .sp-auth-item {
  width: 100%;
}
.sp-auth-item-danger {
  background: transparent;
  border: 1px solid rgba(15, 40, 80, 0.16);
  margin: 4px;
  width: calc(100% - 8px);
  text-align: center;
  border-radius: 10px;
  font-weight: 600;
  color: var(--ink, #0b1220);
}
.sp-auth-item-danger:hover {
  background: #f1f5f9;
  color: var(--ink, #0b1220);
  border-color: rgba(15, 40, 80, 0.28);
}

/* ===== Front profile page (site chrome) ===== */
.profile-page .inner-page { padding: 36px 0 64px; }
.profile-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
.profile-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
  text-align: center;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-letter {
  font-size: 36px;
  font-weight: 800;
  color: var(--blue, #0345BF);
}
.profile-name {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}
.profile-role {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
}
.profile-email {
  margin: 4px 0 14px;
  font-size: 13px;
  color: #64748b;
  word-break: break-all;
}
.profile-avatar-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.profile-avatar-form input[type="file"] {
  font-size: 12px;
  width: 100%;
}
.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 16px;
  text-align: left;
}
.profile-nav a {
  text-decoration: none;
  color: var(--ink, #0b1220);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background .15s;
}
.profile-nav a:hover,
.profile-nav a.is-active {
  background: #f1f5f9;
}
.profile-logout { margin: 0; }
.profile-logout-btn {
  width: 100%;
  border-color: rgba(3, 69, 191, 0.25) !important;
  color: var(--blue, #0345BF) !important;
  background: transparent !important;
}
.profile-logout-btn:hover {
  background: #eef4ff !important;
  border-color: var(--blue, #0345BF) !important;
}
.profile-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.profile-panel {
  background: #fff;
  border-radius: 20px;
  padding: 28px 26px;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
  scroll-margin-top: 90px;
}
.profile-panel h2 {
  margin: 0 0 18px;
  font-size: 20px;
}
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.profile-form input,
.profile-form select,
.profile-form textarea {
  padding: 11px 14px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
  outline: none;
  border-color: var(--blue, #0345BF);
}
.profile-form input:disabled {
  background: #f8fafc;
  color: #64748b;
}
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.profile-check {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  font-weight: 500 !important;
}
.profile-check input {
  width: 18px;
  height: 18px;
}
.profile-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: #64748b;
}
.profile-note a {
  color: var(--blue, #0345BF);
  font-weight: 600;
  text-decoration: none;
}
@media (max-width: 900px) {
  .profile-shell {
    grid-template-columns: 1fr;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }
}
