:root {
  /* Premium Dark Mode Colors */
  --bg-main: #0B0E14; /* Deep slate/obsidian */
  --bg-panel: rgba(18, 23, 33, 0.6); /* Glassmorphism panel base */
  --bg-input: rgba(11, 14, 20, 0.7);
  
  /* Accents */
  --accent-primary: #3b82f6; /* Modern Blue */
  --accent-primary-dim: rgba(59, 130, 246, 0.15);
  --accent-secondary: #8b5cf6; /* Modern Purple */
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-error: #ef4444;
  
  /* Borders and Effects */
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --glow-shadow: 0 0 20px rgba(59, 130, 246, 0.4);

  /* Typography */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'Share Tech Mono', ui-monospace, SFMono-Regular, monospace;
}

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

body {
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 40%),
                    radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.15), transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphic Main Container */
.terminal-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  width: 90%;
  max-width: 1000px;
  height: 75vh;
  max-height: 650px;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
  overflow: hidden;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Panels */
.panel-left {
  border-right: 1px solid var(--border-light);
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0) 100%);
  display: flex;
  flex-direction: column;
  position: relative;
}

.panel-right {
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(18, 23, 33, 0.3);
}

.panel-header {
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.text-right {
  justify-content: flex-end;
}

.header-title {
  color: var(--text-secondary);
  font-weight: 500;
}

.crypto-tag {
  margin-left: auto;
  color: var(--accent-primary);
  background-color: var(--accent-primary-dim);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-indicator::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.4;
  animation: pulse-ring 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 0; }
  50% { opacity: 0.5; }
  100% { transform: scale(1.5); opacity: 0; }
}

.online { background-color: var(--accent-success); }
.waiting { background-color: var(--accent-warning); }

/* Left Panel - Visualizer & Logs */
.visualizer-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  position: relative;
}

.shield-graphic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-primary-dim) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  position: relative;
}

.shield-graphic svg {
  width: 48px;
  height: 48px;
  color: var(--accent-primary);
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.5));
}

.overlay-text {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 8px;
}

.overlay-sub {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 80%;
}

.console-container {
  height: 180px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.console-header {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.console-body {
  flex: 1;
  padding: 16px 24px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.log-line { margin-bottom: 4px; }
.text-info { color: var(--accent-primary); }
.text-warning { color: var(--accent-warning); }

/* Right Panel - Form */
.form-content {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-header {
  margin-bottom: 40px;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.auth-header .description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* OTP Inputs */
.otp-group-wrapper {
  margin-bottom: 36px;
}

.otp-inputs {
  display: flex;
  gap: 12px;
}

.otp-input {
  width: 54px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text-primary);
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.otp-input:focus {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 4px var(--accent-primary-dim);
  transform: translateY(-2px);
}

.input-divider {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-weight: 400;
  font-size: 24px;
}

/* Timer Section */
.timer-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 32px;
  transition: background 0.3s ease;
}

.timer-section:hover {
  background: rgba(255, 255, 255, 0.05);
}

.timer-info {
  display: flex;
  flex-direction: column;
}

.timer-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.timer-countdown {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Actions */
.actions-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.btn-verify {
  width: 100%;
  height: 56px;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-verify:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-verify:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.resend-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-resend {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-resend:hover:not(:disabled) {
  color: #60a5fa;
  text-decoration: underline;
}

.btn-resend:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Footer */
.terminal-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shield-active {
  color: var(--accent-success);
}

/* Success/Failure States */
.success-screen, .failure-screen {
  text-align: center;
  padding: 0 ;
  animation: fadeUp 0.5s ease forwards;
}

.state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
}

.success-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-success);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
        max-width: 150px;
    margin: 0 auto 20px;
}

.failure-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-error);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.2);
      max-width: 150px;
    margin: 0 auto 20px;
}

.state-icon svg {
  width: 40px;
  height: 40px;
}

.btn-retry {
  margin-top: 32px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-retry:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media screen and (max-width: 900px) {
  body {
    padding: 24px 16px;
    height: auto;
    overflow-y: auto;
  }
  
  .terminal-container {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    width: 100%;
  }
  
  .panel-left {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 24px;
  }
  
  .form-content {
    padding: 32px 24px;
  }
  
  .otp-input {
    width: 46px;
    height: 56px;
    font-size: 24px;
  }
}
