/* RVU Edge Connect — Brand styles */

:root {
  --brand-blue: #2980B9;
  --brand-blue-dark: #216694;
  --brand-blue-light: #E6F3FA;
  --accent-green: #48BB78;
  --accent-green-light: #C6F6D5;
  --accent-teal: #0d9488;
  --text-primary: #1A202C;
  --text-secondary: #6B7280;
  --text-muted: #A0AEC0;
  --bg-primary: #F8FAFC;
  --bg-card: #FFFFFF;
  --border-color: #E2E8F0;
  --error-red: #E53E3E;
  --error-red-light: #FED7D7;
  --warning-orange: #ED8936;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Layout ── */

.container {
  max-width: 480px;
  width: 100%;
  padding: 24px 20px;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 32px;
}

.header-logo {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Card ── */

.card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 32px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ── Code Input ── */

.code-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.code-digit {
  width: 52px;
  height: 64px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  -moz-appearance: textfield;
}

.code-digit::-webkit-outer-spin-button,
.code-digit::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.code-digit:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
  background: white;
}

.code-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ── Buttons ── */

.btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s, transform 0.1s;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--brand-blue);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-blue-dark);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-success {
  background-color: var(--accent-green) !important;
  color: white !important;
}

.btn-secondary {
  background-color: transparent;
  color: var(--brand-blue);
  border: 2px solid var(--brand-blue);
  margin-top: 12px;
}

.btn-secondary:hover {
  background-color: var(--brand-blue-light);
}

/* ── Loading State ── */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Success State ── */

.success-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.success-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-icon svg {
  color: var(--accent-green);
}

.success-title {
  font-size: 18px;
  font-weight: 700;
}

.success-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.success-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 12px;
}

.stat {
  flex: 1;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-blue);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Delivery Confirmation ── */

.delivery-confirmation {
  margin-top: 16px;
  padding: 16px;
  background: var(--accent-green-light);
  border-radius: 12px;
  text-align: center;
}

.delivery-confirmation p {
  font-size: 14px;
  color: #276749;
  font-weight: 500;
}

.delivery-confirmation .instructions {
  margin-top: 12px;
  font-size: 13px;
  color: #2F855A;
  font-weight: 400;
  line-height: 1.5;
}

/* ── Extension Badge ── */

.extension-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 20px;
}

.extension-badge.connected {
  background: var(--accent-green-light);
  color: #276749;
}

.extension-badge.disconnected {
  background: var(--error-red-light);
  color: var(--error-red);
}

/* ── Error Message ── */

.error-message {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--error-red-light);
  color: var(--error-red);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
}

/* ── Footer ── */

.footer {
  text-align: center;
  padding: 32px 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer a {
  color: var(--brand-blue);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ── Utility ── */

.hidden {
  display: none !important;
}

/* ── Responsive ── */

@media (max-width: 400px) {
  .code-digit {
    width: 44px;
    height: 56px;
    font-size: 24px;
  }

  .code-input-group {
    gap: 6px;
  }
}
