/*
 * Portfolio Hub authentication portal — focused UI layer.
 *
 * Loaded after portal.html's compatibility styles so this file can evolve the
 * public sign-in/create-account experience without changing superadmin auth or
 * any dashboard surface.
 */

:root {
  --auth-bg: #070a12;
  --auth-panel: #0a0f1b;
  --auth-card: rgba(15, 21, 36, 0.92);
  --auth-card-strong: #111827;
  --auth-input: rgba(255, 255, 255, 0.035);
  --auth-text: #f7f8fc;
  --auth-muted: #9aa3b6;
  --auth-dim: #8590a8;
  --auth-border: rgba(255, 255, 255, 0.09);
  --auth-border-strong: rgba(255, 255, 255, 0.15);
  --auth-accent: #7567f8;
  --auth-accent-light: #9a91ff;
  --auth-accent-dark: #5b4be7;
  --auth-accent-soft: rgba(117, 103, 248, 0.14);
  --auth-success: #34d399;
  --auth-danger: #fb7185;
  --auth-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
  --font-d: "Inter", "Segoe UI", sans-serif;
  --font-b: "Inter", "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  --auth-bg: #eef2ff;
  --auth-panel: #f5f7fb;
  --auth-card: rgba(255, 255, 255, 0.94);
  --auth-card-strong: #ffffff;
  --auth-input: #f7f8fc;
  --auth-text: #13182a;
  --auth-muted: #5f687d;
  --auth-dim: #667085;
  --auth-accent: #6657ea;
  --auth-accent-light: #5546d4;
  --auth-accent-dark: #4939c2;
  --auth-border: rgba(29, 37, 63, 0.1);
  --auth-border-strong: rgba(29, 37, 63, 0.16);
  --auth-accent-soft: rgba(117, 103, 248, 0.1);
  --auth-shadow: 0 30px 75px rgba(53, 62, 98, 0.16);
}

html {
  background: var(--auth-bg);
}

body {
  background: var(--auth-bg);
  color: var(--auth-text);
  font-family: var(--font-b);
  letter-spacing: -0.01em;
}

.portal-skip-link {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 1000;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: var(--auth-card-strong);
  color: var(--auth-text);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transform: translate(-50%, -150%);
  transition: transform 160ms ease;
}

.portal-skip-link:focus {
  transform: translate(-50%, 0);
  outline: 3px solid var(--auth-accent-light);
  outline-offset: 2px;
}

/* Showcase */

.portal-brand {
  flex: 1 1 auto;
  min-width: 0;
  padding: clamp(5.5rem, 9vh, 7.25rem) clamp(3rem, 6vw, 6.5rem) 3.5rem;
  background:
    radial-gradient(circle at 13% 18%, rgba(117, 103, 248, 0.24), transparent 32%),
    radial-gradient(circle at 88% 78%, rgba(69, 47, 173, 0.25), transparent 36%),
    linear-gradient(145deg, #090d18 0%, #0d1323 48%, #10162a 100%);
  isolation: isolate;
}

.portal-brand::before {
  background:
    radial-gradient(circle at 73% 8%, rgba(154, 145, 255, 0.12), transparent 26%),
    linear-gradient(180deg, transparent 55%, rgba(4, 7, 14, 0.28));
}

.portal-brand::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  top: -150px;
  right: 8%;
  border: 1px solid rgba(154, 145, 255, 0.1);
  border-radius: 50%;
  box-shadow:
    0 0 0 50px rgba(154, 145, 255, 0.025),
    0 0 0 100px rgba(154, 145, 255, 0.018);
  pointer-events: none;
  z-index: -1;
}

.portal-brand-grid {
  opacity: 0.7;
  background-image:
    linear-gradient(rgba(130, 120, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 120, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to right, black, rgba(0, 0, 0, 0.38));
}

.portal-brand-inner {
  max-width: 540px;
}

.portal-logo {
  gap: 0.85rem;
  margin-bottom: clamp(2.6rem, 6vh, 4.5rem);
}

.portal-logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  box-shadow:
    0 12px 30px rgba(91, 75, 231, 0.38),
    inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.portal-logo-text {
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.portal-brand .portal-eyebrow {
  width: fit-content;
  margin-bottom: 1.15rem;
  padding: 0.44rem 0.72rem;
  border: 1px solid rgba(154, 145, 255, 0.2);
  border-radius: 999px;
  background: rgba(117, 103, 248, 0.09);
  color: #b8b2ff;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
}

.portal-brand .portal-eyebrow::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9a91ff;
  box-shadow: 0 0 0 4px rgba(154, 145, 255, 0.12);
}

.portal-brand h1 {
  max-width: 600px;
  margin-bottom: 1.25rem;
  font-size: clamp(2.3rem, 3.55vw, 4rem);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.portal-brand h1 span {
  color: #aaa3ff;
}

.portal-brand p.lede {
  max-width: 500px;
  margin-bottom: 2.2rem;
  color: rgba(226, 231, 244, 0.68);
  font-size: clamp(0.94rem, 1.1vw, 1.04rem);
  line-height: 1.7;
}

.portal-feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 500px;
  gap: 0.65rem;
}

.portal-feature-list li {
  min-height: 104px;
  padding: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(237, 240, 249, 0.7);
  font-size: 0.77rem;
  line-height: 1.42;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  backdrop-filter: blur(8px);
}

.portal-feature-dot {
  width: 31px;
  height: 31px;
  border-color: rgba(154, 145, 255, 0.24);
  background: rgba(117, 103, 248, 0.14);
  color: #aaa3ff;
}

.portal-preview {
  position: absolute;
  right: clamp(1.5rem, 3vw, 3rem);
  bottom: clamp(2rem, 5vh, 4rem);
  z-index: 2;
  width: clamp(270px, 18vw, 300px);
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 20px;
  background: rgba(9, 13, 24, 0.78);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  transform: rotate(-1.5deg);
  opacity: 0;
  animation: previewIn 0.7s var(--ease) 0.5s forwards;
}

.portal-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.15rem 0.15rem 0.75rem;
}

.portal-preview-dots {
  display: flex;
  gap: 5px;
}

.portal-preview-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.portal-preview-live {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #86efac;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.portal-preview-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.11);
}

.portal-preview-screen {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 14%, rgba(117, 103, 248, 0.17), transparent 30%),
    #101626;
}

.portal-preview-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.portal-preview-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #8175ff, #5847db);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
}

.portal-preview-name {
  margin: 0 0 0.18rem;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

.portal-preview-role {
  margin: 0;
  color: rgba(220, 225, 241, 0.5);
  font-size: 0.63rem;
}

.portal-preview-projects {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0.55rem;
}

.portal-preview-project {
  min-height: 68px;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.portal-preview-project span,
.portal-preview-project strong {
  display: block;
}

.portal-preview-project span {
  margin-bottom: 0.32rem;
  color: #9187ff;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.portal-preview-project strong {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.66rem;
  line-height: 1.35;
}

/* Form surface */

.portal-form-panel {
  flex: 0 0 clamp(600px, 42vw, 690px);
  width: clamp(600px, 42vw, 690px);
  min-width: 600px;
  padding: 5.2rem clamp(2.5rem, 4vw, 4.5rem) 2.6rem;
  justify-content: flex-start;
  background:
    radial-gradient(circle at 92% 2%, rgba(117, 103, 248, 0.09), transparent 26%),
    var(--auth-panel);
  border-left-color: var(--auth-border);
}

html[data-theme="light"] .portal-form-panel {
  background:
    radial-gradient(circle at 92% 2%, rgba(117, 103, 248, 0.08), transparent 26%),
    var(--auth-panel);
}

.portal-form-inner {
  max-width: 510px;
  margin: auto 0;
  padding: clamp(1.55rem, 3vh, 2rem);
  border: 1px solid var(--auth-border);
  border-radius: 24px;
  background: var(--auth-card);
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(18px);
}

.portal-tabs {
  margin-bottom: 1.7rem;
  padding: 5px;
  border-color: var(--auth-border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="light"] .portal-tabs {
  background: #eef0f6;
}

.portal-tabs-thumb {
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 5px);
  border: 1px solid var(--auth-border);
  border-radius: 9px;
  background: var(--auth-card-strong);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.portal-tab {
  min-height: 42px;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  color: var(--auth-dim);
  font-size: 0.82rem;
  font-weight: 700;
}

.portal-tab:hover {
  color: var(--auth-muted);
}

.portal-tab.is-active {
  color: var(--auth-text);
}

.portal-form-inner .portal-eyebrow {
  width: fit-content;
  margin-bottom: 0.75rem;
  color: var(--auth-accent-light);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
}

.portal-form-inner .portal-eyebrow::before {
  width: 12px;
  background: var(--auth-accent-light);
}

.portal-form-inner h2 {
  margin-bottom: 0.45rem;
  color: var(--auth-text);
  font-size: clamp(1.72rem, 2.2vw, 2rem);
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: -0.045em;
}

.portal-form-inner p.sub {
  margin-bottom: 1.4rem;
  color: var(--auth-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.portal-flash {
  margin-bottom: 0.75rem;
  border-radius: 11px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.portal-flash-danger {
  border-color: rgba(251, 113, 133, 0.24);
  background: rgba(251, 113, 133, 0.1);
  color: #fda4af;
}

.portal-flash-success {
  border-color: rgba(52, 211, 153, 0.22);
  background: rgba(52, 211, 153, 0.09);
  color: #6ee7b7;
}

.portal-oauth-stack {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

.portal-google,
.portal-github {
  min-height: 46px;
  padding: 0.72rem 0.9rem;
  border-color: var(--auth-border-strong);
  border-radius: 11px;
  background: var(--auth-input);
  color: var(--auth-text);
  font-size: 0.82rem;
  font-weight: 650;
}

.portal-google:hover,
.portal-github:hover {
  border-color: rgba(117, 103, 248, 0.58);
  background: var(--auth-accent-soft);
}

.portal-divider {
  margin: 1.1rem 0;
  color: var(--auth-dim);
  font-size: 0.67rem;
}

.portal-divider::before,
.portal-divider::after {
  background: var(--auth-border);
}

.portal-field {
  margin-bottom: 0.95rem;
}

.portal-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 0.75rem;
}

.portal-field label {
  margin-bottom: 0.45rem;
  color: var(--auth-muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: -0.005em;
}

.portal-input-icon-l {
  left: 14px;
  color: var(--auth-dim);
}

.portal-input-icon-r {
  right: 9px;
  color: var(--auth-dim);
}

.portal-input-icon-r:hover {
  color: var(--auth-text);
  background: var(--auth-accent-soft);
}

.portal-field input[type="text"],
.portal-field input[type="email"],
.portal-field input[type="password"] {
  min-height: 48px;
  padding: 0.76rem 2.65rem;
  border-color: var(--auth-border);
  border-radius: 11px;
  background: var(--auth-input);
  color: var(--auth-text);
  font-size: 0.84rem;
}

html[data-theme="light"] .portal-field input[type="text"],
html[data-theme="light"] .portal-field input[type="email"],
html[data-theme="light"] .portal-field input[type="password"] {
  border-color: var(--auth-border-strong);
  background: var(--auth-input);
}

.portal-field input::placeholder {
  color: var(--auth-dim);
  opacity: 0.8;
}

.portal-field input:hover {
  border-color: var(--auth-border-strong);
  background: var(--auth-input);
}

.portal-field input:focus {
  border-color: var(--auth-accent);
  background: var(--auth-accent-soft);
  box-shadow: 0 0 0 4px rgba(117, 103, 248, 0.12);
  transform: none;
}

.portal-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--auth-text) !important;
  -webkit-box-shadow: 0 0 0 1000px #111827 inset !important;
}

html[data-theme="light"] .portal-field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #f7f8fc inset !important;
}

.portal-field:has(.portal-field-err) input {
  border-color: rgba(251, 113, 133, 0.62);
}

.portal-field-err {
  color: var(--auth-danger);
  font-size: 0.72rem;
  line-height: 1.4;
}

.portal-row {
  margin: 0.1rem 0 1.05rem;
  font-size: 0.79rem;
}

.portal-row label {
  color: var(--auth-muted);
  font-size: 0.79rem;
}

.portal-row a,
.portal-check a,
.portal-switch-link {
  color: var(--auth-accent-light);
  font-weight: 600;
}

.portal-row input[type="checkbox"],
.portal-check input {
  width: 17px;
  height: 17px;
}

.portal-check {
  margin: 0.15rem 0 1rem;
  color: var(--auth-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.portal-submit {
  min-height: 48px;
  padding: 0.76rem 1.2rem;
  border-radius: 11px;
  background: linear-gradient(135deg, #8074ff, #5c4be7);
  font-family: var(--font-b);
  font-size: 0.86rem;
  font-weight: 720;
  letter-spacing: -0.01em;
  box-shadow:
    0 12px 30px rgba(91, 75, 231, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.portal-submit:hover {
  box-shadow:
    0 15px 36px rgba(91, 75, 231, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.portal-submit:focus-visible,
.portal-tab:focus-visible,
.portal-google:focus-visible,
.portal-github:focus-visible,
.portal-input-icon-r:focus-visible,
.portal-theme-btn:focus-visible,
.portal-back:focus-visible,
.portal-row a:focus-visible,
.portal-check a:focus-visible,
.portal-switch-link:focus-visible {
  outline: 3px solid rgba(154, 145, 255, 0.55);
  outline-offset: 3px;
}

.portal-switch {
  margin: 1.15rem 0 0 !important;
  text-align: center;
}

.portal-security {
  margin-top: 1.2rem;
  padding-top: 1.15rem;
  border-color: var(--auth-border);
  color: var(--auth-dim);
  font-size: 0.68rem;
}

.portal-security iconify-icon {
  color: var(--auth-success);
}

.portal-password-help {
  margin: -0.2rem 0 0.95rem;
}

.portal-password-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 0.45rem;
}

.portal-password-track span {
  height: 3px;
  border-radius: 999px;
  background: var(--auth-border-strong);
  transition: background 180ms ease;
}

.portal-password-help[data-strength="weak"] .portal-password-track span:nth-child(1) {
  background: #fb7185;
}

.portal-password-help[data-strength="fair"] .portal-password-track span:nth-child(-n + 2) {
  background: #fbbf24;
}

.portal-password-help[data-strength="good"] .portal-password-track span:nth-child(-n + 3) {
  background: #60a5fa;
}

.portal-password-help[data-strength="strong"] .portal-password-track span {
  background: #34d399;
}

.portal-password-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--auth-dim);
  font-size: 0.66rem;
  line-height: 1.35;
}

.portal-password-copy strong {
  color: var(--auth-muted);
  font-weight: 650;
  text-transform: capitalize;
}

.portal-back {
  top: 24px;
  left: clamp(24px, 3vw, 48px);
  padding: 0.62rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(8, 12, 22, 0.42);
  color: rgba(239, 242, 250, 0.68);
  font-size: 0.77rem;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

.portal-back:hover {
  border-color: rgba(154, 145, 255, 0.26);
  color: white;
}

.portal-theme-btn {
  top: 24px;
  right: clamp(24px, 2.5vw, 42px);
  width: 39px;
  height: 39px;
  border-color: var(--auth-border);
  border-radius: 11px;
  background: var(--auth-card);
  color: var(--auth-muted);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.portal-theme-btn:hover {
  border-color: rgba(117, 103, 248, 0.42);
  background: var(--auth-accent-soft);
}

@keyframes previewIn {
  from {
    opacity: 0;
    transform: translateY(14px) rotate(-1.5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(-1.5deg);
  }
}

@media (max-width: 1500px) {
  .portal-preview {
    display: none;
  }

  .portal-brand-inner {
    max-width: 590px;
  }
}

@media (max-width: 1180px) {
  .portal-form-panel {
    flex-basis: 570px;
    width: 570px;
    min-width: 570px;
    padding-inline: 2.25rem;
  }

  .portal-brand {
    padding-inline: 3.25rem;
  }

  .portal-feature-list {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .portal-feature-list li {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }
}

@media (max-width: 940px) {
  body {
    display: block;
    overflow: hidden;
  }

  .portal-brand {
    display: none;
  }

  .portal-form-panel {
    width: 100%;
    min-width: 0;
    height: 100dvh;
    padding: 4.8rem 1.5rem 1.5rem;
    border-left: 0;
  }

  .portal-form-inner {
    width: 100%;
    max-width: 530px;
  }

  .portal-back {
    left: 18px;
    border-color: var(--auth-border);
    background: var(--auth-card);
    color: var(--auth-muted);
  }

  .portal-back:hover {
    color: var(--auth-text);
  }

  .portal-theme-btn {
    right: 18px;
  }
}

@media (max-width: 560px) {
  .portal-form-panel {
    padding: 4.5rem 0.85rem 0.85rem;
  }

  .portal-form-inner {
    padding: 1.2rem;
    border-radius: 19px;
  }

  .portal-field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .portal-oauth-stack {
    grid-template-columns: 1fr;
  }

  .portal-form-inner h2 {
    font-size: 1.62rem;
  }

  .portal-back {
    top: 17px;
    left: 12px;
    max-width: calc(100vw - 74px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .portal-theme-btn {
    top: 17px;
    right: 12px;
  }
}

@media (max-height: 780px) and (min-width: 941px) {
  .portal-form-panel {
    padding-top: 4.4rem;
    padding-bottom: 1.5rem;
  }

  .portal-form-inner {
    padding: 1.45rem;
  }

  .portal-tabs {
    margin-bottom: 1.25rem;
  }

  .portal-form-inner p.sub {
    margin-bottom: 1.05rem;
  }

  .portal-field {
    margin-bottom: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-preview {
    opacity: 1;
    animation: none;
    transform: none;
  }
}
