/* Echo-Null — Quantum Secure Transmission */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&family=Exo+2:wght@300;400;600&display=swap');

:root {
  --en-cyan:   #00f5ff;
  --en-blue:   #0066cc;
  --en-violet: #7c3aed;
  --en-red:    #ff2244;
  --en-green:  #00ff88;
  --en-bg:     #020b18;
  --en-panel:  rgba(0, 20, 45, 0.85);
  --en-border: rgba(0, 245, 255, 0.25);
  --en-text:   #b8d4e8;
  --en-dim:    rgba(0, 245, 255, 0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--en-bg);
  color: var(--en-text);
  font-family: 'Exo 2', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── 우주 배경 ── */
#en-stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(0,102,204,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(124,58,237,0.06) 0%, transparent 60%);
}
#en-stars canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* 스캔라인 오버레이 */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 245, 255, 0.015) 2px,
    rgba(0, 245, 255, 0.015) 4px
  );
}

/* ── 레이아웃 ── */
#en-app {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px;
}

/* ── 패널 (카드) ── */
.en-panel {
  background: var(--en-panel);
  border: 1px solid var(--en-border);
  border-radius: 4px;
  padding: 36px 40px;
  width: 100%; max-width: 480px;
  position: relative;
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 40px rgba(0, 245, 255, 0.06),
    inset 0 1px 0 rgba(0, 245, 255, 0.1);
}
/* 패널 코너 장식 */
.en-panel::before, .en-panel::after {
  content: ''; position: absolute;
  width: 12px; height: 12px;
  border-color: var(--en-cyan); border-style: solid;
}
.en-panel::before { top: 8px; left: 8px; border-width: 1px 0 0 1px; }
.en-panel::after  { bottom: 8px; right: 8px; border-width: 0 1px 1px 0; }

/* ── 헤더 ── */
.en-logo {
  font-family: 'Orbitron', monospace;
  font-size: 22px; font-weight: 900;
  color: var(--en-cyan);
  letter-spacing: 6px;
  text-align: center;
  text-shadow: 0 0 20px rgba(0,245,255,0.6);
  margin-bottom: 4px;
}
.en-tagline {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px; color: var(--en-dim);
  text-align: center; letter-spacing: 2px;
  margin-bottom: 28px;
}

/* 상태 배지 */
.en-status {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px; color: var(--en-green);
  margin-bottom: 24px;
}
.en-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--en-green);
  box-shadow: 0 0 8px var(--en-green);
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes key-reveal {
  0%   { opacity:0; transform:scale(0.95) translateY(8px); }
  60%  { opacity:1; transform:scale(1.02) translateY(-2px); }
  100% { opacity:1; transform:scale(1) translateY(0); }
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── 탭 네비 ── */
.en-tabs {
  display: flex; gap: 0; margin-bottom: 28px;
  border: 1px solid var(--en-border); border-radius: 3px; overflow: hidden;
}
.en-tab {
  flex: 1; padding: 10px; background: transparent;
  border: none; color: var(--en-dim);
  font-family: 'Share Tech Mono', monospace; font-size: 12px;
  letter-spacing: 1px; cursor: pointer;
  transition: all 0.2s;
}
.en-tab.active {
  background: rgba(0, 245, 255, 0.1);
  color: var(--en-cyan);
  box-shadow: inset 0 -2px 0 var(--en-cyan);
}
.en-tab:hover:not(.active) { color: var(--en-text); background: rgba(255,255,255,0.03); }

/* ── 폼 요소 ── */
.en-field { margin-bottom: 16px; }
.en-label {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px; color: var(--en-dim);
  letter-spacing: 1.5px; margin-bottom: 6px;
}
.en-inp, .en-textarea {
  width: 100%;
  background: rgba(0, 245, 255, 0.04);
  border: 1px solid var(--en-border);
  border-radius: 3px;
  color: var(--en-text);
  font-family: 'Share Tech Mono', monospace; font-size: 14px;
  padding: 10px 14px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.en-inp:focus, .en-textarea:focus {
  border-color: var(--en-cyan);
  box-shadow: 0 0 12px rgba(0,245,255,0.15);
}
.en-textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
.en-inp::placeholder, .en-textarea::placeholder { color: rgba(184,212,232,0.3); }

/* ── 신호 유지 시간 그리드 ── */
.en-lifetime-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 8px;
}
.en-lt-btn {
  background: rgba(0,245,255,0.04);
  border: 1px solid var(--en-border);
  border-radius: 3px; padding: 8px 4px;
  color: var(--en-dim);
  font-family: 'Share Tech Mono', monospace; font-size: 11px;
  text-align: center; cursor: pointer; transition: all 0.2s;
  line-height: 1.3;
}
.en-lt-btn .lt-label { display: block; font-size: 10px; color: rgba(0,245,255,0.35); }
.en-lt-btn:hover { border-color: var(--en-cyan); color: var(--en-text); }
.en-lt-btn.selected {
  background: rgba(0,245,255,0.12);
  border-color: var(--en-cyan);
  color: var(--en-cyan);
  box-shadow: 0 0 10px rgba(0,245,255,0.2);
}

/* ── 버튼 ── */
.en-btn {
  width: 100%; padding: 12px;
  background: rgba(0,245,255,0.08);
  border: 1px solid var(--en-cyan);
  border-radius: 3px;
  color: var(--en-cyan);
  font-family: 'Orbitron', monospace; font-size: 13px;
  font-weight: 700; letter-spacing: 2px;
  cursor: pointer; transition: all 0.2s; margin-top: 4px;
}
.en-btn:hover {
  background: rgba(0,245,255,0.15);
  box-shadow: 0 0 20px rgba(0,245,255,0.25);
}
.en-btn:active { transform: scale(0.98); }
.en-btn-danger {
  border-color: var(--en-red); color: var(--en-red);
  background: rgba(255,34,68,0.06);
}
.en-btn-danger:hover {
  background: rgba(255,34,68,0.15);
  box-shadow: 0 0 20px rgba(255,34,68,0.25);
}
.en-btn-ghost {
  border-color: var(--en-border); color: var(--en-dim);
  background: transparent; margin-top: 10px;
}

/* ── 액세스 키 발급 박스 ── */
.en-key-box {
  background: rgba(0,255,136,0.05);
  border: 1px solid rgba(0,255,136,0.3);
  border-radius: 4px; padding: 20px;
  text-align: center; margin-bottom: 20px;
}
.en-key-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px; color: rgba(0,255,136,0.6);
  letter-spacing: 2px; margin-bottom: 10px;
}
.en-key-value {
  font-family: 'Orbitron', monospace;
  font-size: 20px; font-weight: 700;
  color: var(--en-green);
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(0,255,136,0.5);
  cursor: pointer;
  transition: text-shadow 0.2s;
}
.en-key-value:hover { text-shadow: 0 0 30px rgba(0,255,136,0.8); }
.en-key-hint {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px; color: rgba(0,255,136,0.4);
  margin-top: 8px;
}

/* ── 전송된 신호 열람 박스 ── */
.en-signal-panel {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--en-border);
  border-radius: 3px; padding: 20px;
  font-size: 15px; line-height: 1.8;
  color: #d0e8ff;
  min-height: 120px; margin-bottom: 16px;
  font-family: 'Exo 2', sans-serif;
  position: relative; overflow: hidden;
}
/* 열람 패널 스캔 효과 */
.en-signal-panel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,245,255,0.04) 50%, transparent 100%);
  animation: scan-sweep 3s linear infinite;
  pointer-events: none;
}
@keyframes scan-sweep {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* 만료 타이머 */
.en-timer {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px; color: var(--en-dim);
  text-align: right; margin-bottom: 12px;
}
.en-timer span { color: var(--en-cyan); }

/* ── 소각 확인 오버레이 ── */
.en-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(2, 11, 24, 0.92);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.en-confirm-box {
  background: rgba(0,8,20,0.95);
  border: 1px solid var(--en-red);
  border-radius: 4px; padding: 36px;
  max-width: 380px; width: 90%;
  text-align: center;
  box-shadow: 0 0 40px rgba(255,34,68,0.2);
  animation: box-in 0.2s ease;
}
@keyframes box-in { from{transform:scale(0.9);opacity:0} to{transform:scale(1);opacity:1} }
.en-confirm-icon { font-size: 36px; margin-bottom: 16px; }
.en-confirm-title {
  font-family: 'Orbitron', monospace; font-size: 14px;
  color: var(--en-red); letter-spacing: 2px; margin-bottom: 12px;
}
.en-confirm-desc {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px; color: var(--en-dim); line-height: 1.8;
  margin-bottom: 24px;
}
.en-confirm-btns { display: flex; gap: 12px; }
.en-confirm-btns .en-btn { margin-top: 0; }

/* ── 데이터 붕괴 애니메이션 ── */
.en-collapse-wrap {
  position: relative; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 3px;
}
.en-collapse-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px; line-height: 1.7;
  color: #d0e8ff; padding: 20px;
  position: relative; z-index: 2;
  transition: filter 0.3s;
}
.en-collapse-text.glitching {
  animation: glitch-text 0.1s linear infinite;
}
@keyframes glitch-text {
  0%   { clip-path: inset(0 0 95% 0); transform: translate(-2px,0) skewX(-1deg); color: var(--en-red); }
  10%  { clip-path: inset(10% 0 85% 0); transform: translate(2px,0); color: var(--en-cyan); }
  20%  { clip-path: inset(30% 0 60% 0); transform: translate(-1px,0); color: #d0e8ff; }
  30%  { clip-path: inset(50% 0 40% 0); transform: translate(3px,0) skewX(2deg); color: var(--en-red); }
  40%  { clip-path: inset(70% 0 15% 0); transform: translate(-2px,0); color: var(--en-cyan); }
  50%  { clip-path: inset(80% 0 5% 0); transform: translate(0,0); color: #d0e8ff; }
  60%  { clip-path: inset(0 0 0 0); transform: translate(0,0); color: #d0e8ff; }
  100% { clip-path: inset(0 0 0 0); }
}
/* 픽셀 노이즈 오버레이 */
.en-noise-overlay {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  opacity: 0; transition: opacity 0.3s;
}
.en-noise-overlay.active { opacity: 1; }

/* 붕괴 진행 바 */
.en-collapse-bar {
  height: 2px; background: rgba(0,245,255,0.1);
  border-radius: 1px; margin: 12px 0; overflow: hidden;
}
.en-collapse-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--en-violet), var(--en-red), var(--en-cyan));
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--en-red);
}

/* ── 소각 완료 (공허) ── */
.en-void-screen { text-align: center; padding: 20px 0; }
.en-void-icon {
  font-size: 48px; margin-bottom: 20px;
  filter: grayscale(0.5) brightness(0.6);
  animation: void-pulse 3s ease-in-out infinite;
}
@keyframes void-pulse { 0%,100%{opacity:0.4;transform:scale(1)} 50%{opacity:0.7;transform:scale(1.05)} }
.en-void-title {
  font-family: 'Orbitron', monospace; font-size: 13px;
  color: var(--en-dim); letter-spacing: 3px; margin-bottom: 10px;
}
.en-void-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px; color: rgba(184,212,232,0.3); line-height: 2;
}

/* ── 회원 목록 ── */
.en-scroll-list { list-style: none; }
.en-scroll-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--en-border); border-radius: 3px;
  margin-bottom: 8px; cursor: pointer;
  transition: all 0.2s; background: rgba(0,245,255,0.02);
}
.en-scroll-item:hover {
  border-color: var(--en-cyan);
  background: rgba(0,245,255,0.06);
}
.en-scroll-item-key {
  font-family: 'Orbitron', monospace; font-size: 12px;
  color: var(--en-cyan); letter-spacing: 2px;
}
.en-scroll-item-meta {
  font-family: 'Share Tech Mono', monospace; font-size: 10px;
  color: var(--en-dim); text-align: right;
}
.en-scroll-item-meta .exp { color: var(--en-red); }

/* ── 알림 토스트 ── */
.en-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(0,20,45,0.95); border: 1px solid var(--en-cyan);
  border-radius: 3px; padding: 10px 20px;
  font-family: 'Share Tech Mono', monospace; font-size: 12px; color: var(--en-cyan);
  letter-spacing: 1px; z-index: 200;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.2s forwards;
  box-shadow: 0 0 20px rgba(0,245,255,0.2);
}
@keyframes toast-in  { from{opacity:0;transform:translateX(-50%) translateY(10px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
@keyframes toast-out { from{opacity:1} to{opacity:0} }

/* ── 경고문 (비회원 초과) ── */
.en-warning-box {
  background: rgba(255,34,68,0.06);
  border: 1px solid rgba(255,34,68,0.3);
  border-radius: 3px; padding: 16px;
  font-family: 'Share Tech Mono', monospace; font-size: 12px;
  color: rgba(255,100,120,0.9); line-height: 1.9; margin-bottom: 16px;
}

/* ── 인증 화면 ── */
.en-auth-sep {
  display: flex; align-items: center; gap: 10px; margin: 20px 0;
  font-family: 'Share Tech Mono', monospace; font-size: 10px; color: var(--en-border);
}
.en-auth-sep::before, .en-auth-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--en-border);
}

.en-panel.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-6px)}
  40%{transform:translateX(6px)}
  60%{transform:translateX(-4px)}
  80%{transform:translateX(4px)}
}

/* ── 모바일 ── */
@media(max-width:500px) {
  .en-panel { padding: 24px 20px; }
  .en-logo { font-size: 18px; letter-spacing: 4px; }
  .en-lifetime-grid { grid-template-columns: repeat(2, 1fr); }
  .en-key-value { font-size: 16px; letter-spacing: 2px; }
}

/* ── 로그인/로그아웃 상단 바 ── */
.en-topbar {
  position: fixed; top: 0; right: 0; z-index: 10;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
  font-family: 'Share Tech Mono', monospace; font-size: 11px; color: var(--en-dim);
}
.en-topbar a, .en-topbar button {
  color: var(--en-dim); text-decoration: none;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: inherit;
  transition: color 0.2s;
}
.en-topbar a:hover, .en-topbar button:hover { color: var(--en-cyan); }
.en-topbar .user-name { color: var(--en-cyan); }