/* auth-widget.css — shared login card styling (Task 2b).
   References CSS custom properties (--orange, --bg-white, etc.) that each
   page already defines in its own :root — custom properties resolve at use
   time, so load order relative to this stylesheet doesn't matter. */

.aw-trigger-wrap { position: relative; }
.aw-trigger {
  background: var(--orange); color: #fff; border: none; border-radius: 10px;
  padding: 8px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: var(--font);
}
.aw-trigger:hover { background: var(--orange-dark); }

.aw-card {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-white); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; width: 280px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 500;
}
.aw-card.open { display: block; }

/* Task 2b rewrite: the trigger reveals a small role-choice menu first (User /
   Lawyer) for signed-out visitors — picking one is what opens .aw-card. */
.aw-role-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-white); border: 1px solid var(--border); border-radius: 14px;
  padding: 6px; width: 230px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 500;
}
.aw-role-menu.open { display: block; }
.aw-role-menu-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px;
  border: none; background: transparent; font-family: var(--font); font-size: 13.5px;
  font-weight: 600; color: var(--text-dark); cursor: pointer;
}
.aw-role-menu-item:hover { background: var(--orange-light); color: var(--orange-dark); }

/* Profile-navigation fix (PROFILE_NAVIGATION_AND_PRACTICE_STATES_SPEC.md,
   Command B): the same trigger, once logged in, opens this account menu
   instead of signing out immediately — mirrors .aw-role-menu's shape
   exactly, just a different item set and an extra visual break before the
   destructive "Log out" action. */
.aw-account-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-white); border: 1px solid var(--border); border-radius: 14px;
  padding: 6px; width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 500;
}
.aw-account-menu.open { display: block; }
.aw-account-menu-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px;
  border: none; background: transparent; font-family: var(--font); font-size: 13.5px;
  font-weight: 600; color: var(--text-dark); cursor: pointer;
}
.aw-account-menu-item:hover { background: var(--orange-light); color: var(--orange-dark); }
.aw-account-menu-item.aw-account-menu-logout {
  margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px; color: var(--text-mid);
}
.aw-account-menu-item.aw-account-menu-logout:hover { background: #fef2f2; color: #b91c1c; }

.aw-close {
  position: absolute; top: 10px; right: 10px; background: transparent; border: none;
  cursor: pointer; font-size: 16px; line-height: 1; color: var(--text-light); padding: 4px;
}
.aw-close:hover { color: var(--text-dark); }

.aw-btn {
  width: 100%; padding: 10px 14px; border-radius: 10px; font-family: var(--font); font-size: 13.5px;
  font-weight: 600; cursor: pointer; border: 1.5px solid var(--border); background: var(--bg-white);
  color: var(--text-dark); margin-top: 8px; display: flex; align-items: center; justify-content: center;
}
.aw-btn:first-child { margin-top: 4px; }
.aw-btn:hover { border-color: var(--orange); background: var(--orange-light); }
.aw-btn:disabled { opacity: .6; cursor: not-allowed; }
.aw-btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.aw-btn-primary:hover { background: var(--orange-dark); }

.aw-card input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: 13.5px; margin-top: 4px; background: var(--bg-cream);
  color: var(--text-dark); outline: none; box-sizing: border-box;
}
.aw-card input:focus { border-color: var(--orange); }

.aw-hint { font-size: 12.5px; color: var(--text-mid); margin-bottom: 4px; }

.aw-error {
  display: none; margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 12px;
}
.aw-error.visible { display: block; }

.aw-back {
  display: block; text-align: center; margin-top: 10px; font-size: 12px;
  color: var(--text-light); cursor: pointer; text-decoration: underline;
}

.aw-spinner {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: aw-spin .7s linear infinite; vertical-align: middle; margin-right: 6px;
}
.aw-btn:not(.aw-btn-primary) .aw-spinner { border-color: rgba(26,35,50,0.25); border-top-color: var(--text-dark); }

@keyframes aw-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .aw-card { width: 240px; right: -10px; }
  .aw-role-menu { width: 200px; right: -10px; }
  .aw-account-menu { width: 180px; right: -10px; }
}
