/* Late Hours — Portal (login page) */

.portal {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(80px, 12vh, 140px) clamp(20px, 5vw, 60px) 100px;
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  position: relative;
  z-index: 2;
}

@media (max-width: 900px) {
  .portal {
    grid-template-columns: 1fr;
  }
  .portal-side {
    display: none;
  }
}

/* ─── Card ─── */
.portal-card {
  position: relative;
  background: linear-gradient(180deg, rgba(180, 100, 255, 0.04) 0%, rgba(10, 10, 15, 0.6) 100%);
  border: 1px solid rgba(180, 100, 255, 0.14);
  border-radius: 20px;
  padding: clamp(28px, 4vw, 44px);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: portalIn 0.9s cubic-bezier(0.19, 1, 0.22, 1) both;
}

@keyframes portalIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.portal-header {
  margin-bottom: 32px;
}

.portal-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(180, 100, 255, 0.25);
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--violet-fg, #d4a8ff);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.portal-tag-dot {
  width: 6px;
  height: 6px;
  background: #b464ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #b464ff;
  animation: pulseDot 2.4s ease-in-out infinite;
}

.portal-title {
  font-size: clamp(38px, 5.5vw, 60px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  color: #fff;
}
.portal-title-line {
  display: block;
}
.portal-title-accent {
  background: linear-gradient(90deg, #b464ff 0%, #64c8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
  font-weight: 400;
  animation: shift 8s ease-in-out infinite;
  background-size: 200% 100%;
}
@keyframes shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.portal-sub {
  font-size: 14px;
  color: var(--text-dim, #7a7a90);
  line-height: 1.5;
  margin: 0;
  max-width: 40ch;
}

/* ─── Form ─── */
.portal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-dim, #7a7a90);
  text-transform: uppercase;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field-wrap:focus-within {
  border-color: rgba(180, 100, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(180, 100, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
}

.field input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.field input::placeholder {
  color: #4a4a5c;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.field-marker {
  padding-right: 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #4a4a5c;
}

.field-toggle {
  background: transparent;
  border: 0;
  padding: 0 14px;
  color: #6a6a7c;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.15s ease;
}
.field-toggle:hover { color: #b464ff; }

/* ─── Remember checkbox ─── */
.portal-remember {
  margin-top: 4px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.check-box {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}
.check input:checked + .check-box {
  border-color: #b464ff;
  background: rgba(180, 100, 255, 0.2);
}
.check input:checked + .check-box::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #b464ff;
  border-radius: 1px;
  box-shadow: 0 0 6px #b464ff;
}
.check-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-dim, #7a7a90);
  text-transform: uppercase;
}

/* ─── Submit button ─── */
.portal-submit {
  margin-top: 8px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #b464ff 0%, #8a3fe0 100%);
  border: 0;
  border-radius: 10px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow:
    0 8px 24px -8px rgba(180, 100, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.portal-submit:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 32px -8px rgba(180, 100, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.portal-submit:active {
  transform: translateY(0);
}
.portal-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 3s ease-in-out infinite;
  animation-delay: 1s;
}
@keyframes shimmer {
  0%, 100% { transform: translateX(-100%); }
  50%      { transform: translateX(100%); }
}

.submit-arrow {
  transition: transform 0.2s ease;
}
.portal-submit:hover .submit-arrow {
  transform: translateX(3px);
}

.portal-note {
  margin-top: 6px;
  font-size: 11px;
  color: #4a4a5c;
  letter-spacing: 0.02em;
  text-align: center;
}

/* ─── Bottom links ─── */
.portal-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.portal-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.portal-links a {
  font-size: 11px;
  color: var(--text-dim, #7a7a90);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.15s ease;
}
.portal-links a:hover {
  color: #b464ff;
}
.portal-uplink {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #4a4a5c;
}

/* ─── Side log panel ─── */
.portal-side {
  padding-top: 48px;
  animation: portalIn 0.9s cubic-bezier(0.19, 1, 0.22, 1) 0.15s both;
}

.side-frame {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.side-frame-header {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-dim, #7a7a90);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.side-frame-header span:first-child {
  color: #b464ff;
  animation: pulseDot 2.4s ease-in-out infinite;
}

.side-frame-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-line {
  font-size: 11px;
  letter-spacing: 0.01em;
  color: #6a6a7c;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: logIn 0.5s ease both;
  opacity: 0.75;
}

.log-line:nth-child(1) { animation-delay: 0.2s; }
.log-line:nth-child(2) { animation-delay: 0.35s; }
.log-line:nth-child(3) { animation-delay: 0.5s; }
.log-line:nth-child(4) { animation-delay: 0.65s; }
.log-line:nth-child(5) { animation-delay: 0.8s; }
.log-line:nth-child(6) { animation-delay: 0.95s; }
.log-line:nth-child(7) { animation-delay: 1.1s; }
.log-line:nth-child(8) { animation-delay: 1.25s; opacity: 1; }

@keyframes logIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 0.75; transform: translateX(0); }
}

.log-time {
  color: #3a3a4c;
  font-size: 10px;
}

.log-tag {
  min-width: 22px;
  text-align: center;
  font-weight: 500;
}
.log-ok   { color: #64ffa0; }
.log-info { color: #64c8ff; }

.log-blink {
  animation: logBlink 1.6s ease-in-out infinite;
}
@keyframes logBlink {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 0.4; }
}

/* ─── Loading state ─── */
.portal-submit.is-loading {
  pointer-events: none;
}
.portal-submit.is-loading .submit-text::after {
  content: '';
  display: inline-block;
  width: 6px;
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

.portal-submit.is-loading .submit-arrow {
  opacity: 0.4;
}
