/* ============================================================
   CorfuDiscovery  -  Auth modal (Sign in / Create account)
   Self-contained: loaded on every page.
   ============================================================ */

.auth-back {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,30,43,.55); backdrop-filter: blur(4px);
  display: none; place-items: center; padding: 20px;
}
.auth-back.open { display: grid; }

.auth-modal {
  width: min(940px, 100%); max-height: calc(100vh - 40px); overflow: hidden;
  background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: 0.82fr 1fr;
}
@media (max-width: 720px){ .auth-modal { grid-template-columns: 1fr; max-height: calc(100vh - 24px); } }

/* brand panel */
.auth-aside { position: relative; color: #fff; isolation: isolate; padding: 36px 32px; display: flex; flex-direction: column; overflow: hidden; }
.auth-aside .cph { position: absolute; inset: 0; z-index: -2; }
.auth-aside::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(165deg, rgba(15,42,59,.86), rgba(10,30,43,.92) 60%, rgba(197,63,43,.65)); }
.auth-aside .brand { gap: 11px; }
.auth-aside .brand img { width: 40px; height: 40px; border-radius: 50%; }
.auth-aside .brand b { font-family: var(--serif); font-weight: 600; font-size: 19px; color: #fff; }
.auth-aside .brand small { color: #FFD9CF; }
.auth-aside .pitch { margin-top: auto; }
.auth-aside .pitch h3 { font-family: var(--serif); font-weight: 500; font-size: 27px; line-height: 1.12; letter-spacing: -.01em; }
.auth-aside .pitch ul { margin-top: 20px; display: flex; flex-direction: column; gap: 13px; }
.auth-aside .pitch li { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: rgba(255,255,255,.92); }
.auth-aside .pitch li svg { width: 20px; height: 20px; color: #FFD9CF; flex-shrink: 0; }
@media (max-width: 720px){ .auth-aside { display: none; } }

/* form panel */
.auth-body { padding: 30px 34px 34px; overflow-y: auto; position: relative; }
.auth-close { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; transition: .15s; z-index: 3; }
.auth-close:hover { border-color: var(--coral); color: var(--coral); }
.auth-close svg { width: 20px; height: 20px; }

.auth-tabs { display: inline-flex; background: var(--sand-2); border-radius: var(--pill); padding: 4px; gap: 4px; margin-bottom: 26px; }
.auth-tabs button { padding: 9px 20px; border-radius: var(--pill); font-weight: 600; font-size: 14.5px; color: var(--muted); transition: .18s; }
.auth-tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.auth-pane { display: none; }
.auth-pane.on { display: block; }
.auth-pane h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -.01em; }
.auth-pane .sub { color: var(--body); margin-top: 6px; margin-bottom: 22px; font-size: 15px; }

.auth-field { margin-bottom: 15px; }
.auth-field label { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; margin-bottom: 7px; }
.auth-field input {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--r); padding: 12px 15px;
  font-size: 15px; font-weight: 500; background: var(--sand); outline: none; transition: .15s;
}
.auth-field input:focus { border-color: var(--coral); background: #fff; box-shadow: 0 0 0 4px var(--coral-soft); }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 13.5px; }
.auth-row label { display: flex; align-items: center; gap: 8px; color: var(--body); font-weight: 500; cursor: pointer; }
.auth-row input { width: 17px; height: 17px; accent-color: var(--coral); }
.auth-row a { color: var(--coral); font-weight: 600; }
.auth-body .btn { width: 100%; padding-block: 14px; font-size: 15.5px; }

.auth-or { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-social button, .auth-social a { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1.5px solid var(--line-strong); border-radius: var(--r); padding: 11px; font-weight: 600; font-size: 14px; color: var(--ink); background: #fff; transition: .15s; }
.auth-social button:hover, .auth-social a:hover { border-color: var(--ink); background: var(--sand); }
.auth-social svg { width: 18px; height: 18px; }

/* status / error message */
.auth-msg { margin: 0 0 16px; padding: 11px 14px; border-radius: var(--r); font-size: 14px; font-weight: 600;
  background: #fdecea; color: #b5341f; border: 1px solid #f6cfc8; }
.auth-msg.ok { background: #eaf6ee; color: #1f7a44; border-color: #c9e8d4; }

/* ============================================================
   Logged-in user menu (header)
   ============================================================ */
.cdf-user-menu { position: relative; }
.cdf-user-trigger { display: inline-flex; align-items: center; gap: 9px; padding: 6px 8px 6px 6px; border-radius: var(--pill);
  border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14.5px; color: var(--ink); transition: .18s; cursor: pointer; }
.cdf-user-trigger:hover { border-color: var(--coral); color: var(--coral); }
.cdf-user-trigger .avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex-shrink: 0; }
.cdf-user-trigger .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cdf-user-trigger .uname { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdf-user-trigger .caret { width: 14px; height: 14px; opacity: .6; transition: transform .2s; }
.cdf-user-menu.open .cdf-user-trigger .caret { transform: rotate(180deg); }

.cdf-user-dd { position: absolute; top: calc(100% + 10px); right: 0; min-width: 256px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s ease; z-index: 120; }
.cdf-user-menu.open .cdf-user-dd { opacity: 1; visibility: visible; transform: translateY(0); }
.cdf-user-dd-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.cdf-user-dd-head .avatar { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.cdf-user-dd-head .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cdf-user-dd-head .meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.cdf-user-dd-head .meta b { font-size: 15px; }
.cdf-user-dd-head .meta small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdf-user-dd ul { list-style: none; margin: 0; padding: 0; }
.cdf-user-dd li a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: var(--body); }
.cdf-user-dd li a:hover { background: var(--sand-2); color: var(--coral); }
.cdf-user-dd li a svg { width: 18px; height: 18px; flex-shrink: 0; }
.cdf-user-dd li.is-logout { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; }
.cdf-user-dd li.is-logout a { color: var(--coral-deep); font-weight: 600; }
@media (max-width: 1080px){ .cdf-user-menu { display: none; } }
.auth-foot { text-align: center; font-size: 14px; color: var(--body); margin-top: 20px; }
.auth-foot a { color: var(--coral); font-weight: 700; }

/* role chooser (sign up) */
.role-pick { display: grid; gap: 13px; margin-bottom: 8px; }
.role {
  display: flex; gap: 15px; align-items: center; text-align: left; width: 100%;
  border: 1.6px solid var(--line-strong); border-radius: var(--r); padding: 16px 18px; background: #fff; transition: .16s; cursor: pointer;
}
.role:hover { border-color: var(--coral); background: var(--coral-soft); }
.role.sel { border-color: var(--coral); background: var(--coral-soft); box-shadow: 0 0 0 3px var(--coral-soft-2); }
.role .ri { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.role .ri svg { width: 25px; height: 25px; }
.role.discoverer .ri { background: #E4F3F6; color: #1b7f93; }
.role.partner .ri { background: var(--coral-soft-2); color: var(--coral-deep); }
.role .rt b { font-size: 16.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.role .rt .tagk { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--coral-deep); background: #fff; padding: 2px 7px; border-radius: var(--pill); }
.role .rt p { font-size: 13.5px; color: var(--body); margin-top: 3px; }
.role .rcheck { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); flex-shrink: 0; display: grid; place-items: center; transition: .15s; }
.role.sel .rcheck { border-color: var(--coral); background: var(--coral); }
.role .rcheck svg { width: 14px; height: 14px; color: #fff; opacity: 0; transition: .15s; }
.role.sel .rcheck svg { opacity: 1; }

.signup-step2 { display: none; }
.signup-step2.on { display: block; }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 16px; }
.back-link:hover { color: var(--coral); }
.back-link svg { width: 15px; height: 15px; }
.chosen-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: var(--pill); background: var(--coral-soft); color: var(--coral-deep); margin-bottom: 18px; }
.chosen-chip svg { width: 15px; height: 15px; }
