.shell-gradient {
  position: relative;
  overflow: hidden;
}

.pf-shell {
  flex-direction: row;
  gap: 0;
}

.pf-hero-pane,
.pf-auth-pane {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
}

.pf-hero-pane {
  flex: 1 1 48%;
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vh, 2.5rem);
  padding: clamp(var(--pf-space-4), calc(3vw + 1.25rem), var(--pf-space-5));
  background: rgba(22, 36, 52, 0.98);
  color: rgba(228, 234, 244, 0.92);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.pf-hero-pane > div:first-of-type {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vh, 2rem);
}

.pf-hero-header {
  display: block;
}

.pf-hero-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.pf-hero-logo {
  width: clamp(72px, 10vw, 120px);
  height: auto;
  display: block;
}

.pf-hero-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pf-hero-title-wrap .pf-heading-2 {
  font-size: clamp(1.3rem, 2.8vw, 1.55rem);
  font-weight: 700;
  color: #ffffff;
}

.pf-hero-pane h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.9vw, 2.2rem);
  line-height: 1.3;
  color: #ffffff;
}

.pf-hero-pane p {
  margin: 0;
  max-width: 480px;
  color: rgba(226, 230, 241, 0.82);
  font-size: clamp(0.95rem, 1.1vw, 1rem);
  line-height: 1.65;
}

.pf-hero-points {
  display: grid;
  gap: var(--pf-space-2);
  max-width: 380px;
}

.pf-hero-point {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--pf-radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(240, 244, 255, 0.85);
}

.pf-hero-point svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@media (hover: hover) {
  .pf-hero-point:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
  }
}

.pf-auth-pane {
  flex: 1 1 52%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(var(--pf-space-3), 3vh, var(--pf-space-4));
  padding: clamp(var(--pf-space-4), calc(3vw + 1rem), var(--pf-space-5));
  background: var(--pf-color-surface);
}

.pf-auth-card {
  width: min(480px, 100%);
  background: var(--pf-color-surface-elevated);
  border: 1px solid var(--pf-color-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow-soft);
  padding: clamp(var(--pf-space-4), calc(3vw + 0.75rem), var(--pf-space-5));
  display: flex;
  flex-direction: column;
  gap: var(--pf-space-4);
}

.pf-auth-card:focus-within {
  border-color: var(--pf-color-border-strong);
  box-shadow: 0 32px 60px rgba(0, 170, 175, 0.2);
}

.pf-auth-card header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pf-auth-card h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.6vw, 1.5rem);
  color: var(--pf-color-text-primary);
}

.pf-auth-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--pf-color-text-secondary);
}

.pf-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--pf-radius-lg);
  border: 1px solid var(--pf-color-border);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, background 0.2s ease;
  flex-wrap: wrap;
}

.pf-tab {
  flex: 1 1 8rem;
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  color: var(--pf-color-text-secondary);
  font-weight: 500;
  border-radius: var(--pf-radius-md);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.pf-tab[aria-selected="true"] {
  background: var(--pf-gradient-accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(60, 20, 105, 0.32);
}

.pf-tab:focus-visible {
  outline: 2px solid rgba(0, 170, 175, 0.55);
  outline-offset: 2px;
}

#auth-message {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#auth-message:not(.is-hidden) {
  animation: pf-slide-down 0.35s ease;
}

.is-hidden {
  display: none !important;
}

.pf-auth-card form,
.pf-auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--pf-space-3);
}

.pf-auth-form[hidden],
.pf-auth-form[aria-hidden="true"] {
  display: none !important;
}

.pf-auth-card .pf-button {
  width: 100%;
  justify-content: center;
}

.pf-field-row {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

.pf-field-row input {
  flex: 1 1 auto;
}

.pf-field-row span {
  display: flex;
  align-items: center;
}

.pf-field-row select {
  min-width: 150px;
  border-radius: var(--pf-radius-md) !important;
}

.pf-validation-message {
  margin-top: -0.35rem;
}

.pf-dashboard {
  display: none;
  flex-direction: column;
  gap: var(--pf-space-3);
  width: 100%;
  animation: pf-fade-in 0.45s ease both;
}

.pf-dashboard.active {
  display: flex;
}

#dashboard-message {
  align-self: stretch;
  margin-bottom: var(--pf-space-2);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#dashboard-message:not(.is-hidden) {
  animation: pf-slide-down 0.35s ease;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pf-space-3);
  background: var(--pf-color-surface-elevated);
  border: 1px solid var(--pf-color-border);
  border-radius: var(--pf-radius-lg);
  padding: var(--pf-space-3);
  box-shadow: var(--pf-shadow-soft);
}

.pf-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pf-space-1);
  color: var(--pf-color-text-secondary);
}

.pf-user-chip {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(0, 170, 175, 0.16);
  color: var(--pf-color-text-primary);
  font-weight: 600;
}

.pf-apps-grid {
  display: grid;
  gap: var(--pf-space-2);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.pf-app-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--pf-color-border);
  border-radius: var(--pf-radius-lg);
  padding: var(--pf-space-2);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 190px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  cursor: pointer;
}

.pf-app-card h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--pf-color-text-primary);
}

.pf-app-card p {
  margin: 0;
  color: var(--pf-color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.pf-app-tag {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pf-color-text-secondary);
}

.pf-app-card:focus-visible {
  outline: 2px solid rgba(0, 170, 175, 0.6);
  outline-offset: 2px;
}

.pf-app-card[data-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.72;
}

@media (hover: hover) {
  .pf-app-card:hover {
    transform: translate3d(0, -4px, 0);
    box-shadow: 0 18px 38px rgba(4, 8, 16, 0.45);
    border-color: rgba(0, 170, 175, 0.35);
    background: rgba(255, 255, 255, 0.06);
  }
}

.pf-app-card:active {
  transform: translate3d(0, -1px, 0);
}

@media (max-width: 1280px) {
  .pf-shell {
    width: min(1080px, 98vw);
  }
}

@media (max-width: 1100px) {
  .pf-hero-pane {
    padding: clamp(var(--pf-space-4), 5vw, var(--pf-space-5));
  }

  .pf-auth-pane {
    padding: clamp(var(--pf-space-4), 5vw, var(--pf-space-5));
  }
}

@media (max-width: 1024px) {
  .pf-shell {
    flex-direction: column;
    width: min(920px, 100%);
    min-height: auto;
    border-radius: var(--pf-radius-xl);
  }

  .pf-hero-pane {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: clamp(var(--pf-space-4), 5vw, var(--pf-space-4));
    gap: var(--pf-space-3);
  }

  .pf-hero-pane > div:first-of-type {
    gap: var(--pf-space-2);
  }

  .pf-hero-points {
    margin-top: var(--pf-space-2);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .pf-auth-pane {
    width: 100%;
    padding: clamp(var(--pf-space-4), 5vw, var(--pf-space-4));
    align-items: stretch;
  }

  .pf-auth-card {
    margin: 0 auto;
    max-height: calc(100vh - 6rem);
  }
}

@media (max-width: 820px) {
  .pf-hero-pane {
    max-height: clamp(300px, 48vh, 380px);
  }

  .pf-hero-points {
    grid-template-columns: 1fr;
  }

  .pf-auth-card {
    width: min(520px, 100%);
  }
}

@media (max-width: 640px) {
  .pf-shell {
    border-radius: var(--pf-radius-lg);
    box-shadow: none;
  }

  .pf-hero-pane {
    padding: var(--pf-space-3);
    max-height: clamp(280px, 42vh, 340px);
    gap: var(--pf-space-2);
    background: linear-gradient(180deg, rgba(22, 36, 52, 0.94), rgba(13, 19, 28, 0.88));
  }

  .pf-hero-pane h1 {
    font-size: clamp(1.45rem, 5.4vw, 1.75rem);
  }

  .pf-hero-pane p {
    font-size: 0.9rem;
  }

  .pf-hero-points {
    gap: var(--pf-space-1);
  }

  .pf-hero-point {
    padding: 0.65rem 0.85rem;
  }

  .pf-auth-pane {
    padding: var(--pf-space-3);
    gap: var(--pf-space-3);
  }

  .pf-auth-card {
    padding: var(--pf-space-3);
    max-height: none;
    box-shadow: none;
    border-radius: var(--pf-radius-lg);
  }

  .pf-tabs {
    width: 100%;
  }

  .pf-field-row {
    flex-direction: column;
  }

  .pf-field-row span,
  .pf-field-row select {
    width: 100%;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .pf-auth-card h2 {
    font-size: 1.25rem;
  }

  .pf-tab {
    flex: 1 1 100%;
  }
}

@media (max-width: 380px) {
  body {
    padding-inline: 0.4rem;
  }

  .pf-shell {
    border-radius: var(--pf-radius-md);
  }

  .pf-hero-pane {
    padding: 1.35rem 1.4rem;
  }

  .pf-auth-card {
    padding: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-hero-pane,
  .pf-auth-pane,
  .pf-auth-card,
  .pf-dashboard,
  .pf-app-card,
  #auth-message {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
    padding: 0;
  }

  .shell-gradient::before,
  .shell-gradient::after {
    display: none;
  }

  .pf-shell {
    width: 100%;
    box-shadow: none;
    border: none;
  }

  .pf-hero-pane {
    display: none;
  }

  .pf-auth-pane {
    background: #ffffff;
    padding: 1.5rem;
  }

  .pf-auth-card {
    box-shadow: none;
    border: 1px solid #d1d5db;
  }

  .pf-dashboard.active {
    display: block;
  }

  .pf-app-card {
    break-inside: avoid;
    border-color: #d1d5db;
    background: #ffffff;
  }
}

@keyframes pf-fade-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pf-fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pf-slide-down {
  from {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
