/* =============================================================================
   VPN Block Checker - Styles
   Minimal dark theme with glassmorphism
   ============================================================================= */

:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.05);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.4);

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;

  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Sizing */
  --radius: 16px;
  --radius-sm: 8px;
}

/* =============================================================================
   Reset & Base
   ============================================================================= */

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

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* =============================================================================
   Layout
   ============================================================================= */

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.screen {
  display: none;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================================================
   Card
   ============================================================================= */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 48px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  text-align: center;
  min-width: min-content;
}

.results-card {
  max-width: 500px;
}

.logo {
  font-size: 48px;
  margin-bottom: 16px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

/* =============================================================================
   PIN Input
   ============================================================================= */

.pin-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

/* Desktop: show 9 inputs */
.pin-desktop {
  display: flex;
}

/* Mobile: hidden by default */
.pin-mobile {
  display: none;
}

.pin-input {
  width: 44px;
  height: 56px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

/* Mobile single input */
.pin-input-mobile {
  width: 100%;
  max-width: 200px;
  height: 56px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  letter-spacing: 2px;
  transition: border-color 0.2s, background 0.2s;
}

.pin-input-mobile:focus {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.pin-input-mobile.error {
  border-color: var(--error);
  animation: shake 0.4s ease-out;
}

.pin-input-mobile::placeholder {
  color: var(--text-muted);
  letter-spacing: 1px;
}

.pin-input:focus {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.pin-input.error {
  border-color: var(--error);
  animation: shake 0.4s ease-out;
}

.pin-separator {
  color: var(--text-muted);
  font-size: 1.2rem;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-4px);
  }

  40%,
  80% {
    transform: translateX(4px);
  }
}

/* =============================================================================
   Buttons
   ============================================================================= */

.btn-primary {
  width: 100%;
  padding: 16px 32px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

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

.btn-secondary {
  width: 100%;
  padding: 14px 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-top: 24px;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* =============================================================================
   Loader
   ============================================================================= */

.btn-loader {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =============================================================================
   Results
   ============================================================================= */

.results-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

/* Results Actions */
.results-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}

.results-actions button {
  width: 100%;
}

/* Secondary Link Button */
.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  padding: 8px;
  font-size: 0.9rem;
  transition: color 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.btn-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.btn-link.success {
  color: var(--success);
}

/* Flood Warning Banner */
.flood-warning {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.flood-warning-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.flood-warning-content {
  flex: 1;
}

.flood-warning-title {
  font-weight: 600;
  color: var(--warning);
  margin-bottom: 4px;
}

.flood-warning-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.results-list {
  margin-top: 32px;
  text-align: left;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-country {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-status {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
}

.result-status.ok {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.result-status.fail {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.result-status.fail-detail {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* =============================================================================
   Utilities
   ============================================================================= */

.hidden {
  display: none !important;
}

.error {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 16px;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 480px) {
  .container {
    padding: 12px;
    align-items: flex-start;
    padding-top: 60px;
  }

  .screen {
    max-width: 100%;
  }

  .card {
    padding: 24px 16px;
  }

  /* Hide desktop PIN, show mobile PIN */
  .pin-desktop {
    display: none !important;
  }

  .pin-mobile {
    display: flex !important;
  }

  .pin-container {
    gap: 0;
  }

  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .result-status {
    align-self: flex-start;
  }

  h1 {
    font-size: 1.2rem;
  }

  .subtitle {
    font-size: 0.85rem;
    margin-bottom: 24px;
  }

  .logo {
    font-size: 40px;
    margin-bottom: 12px;
  }

  .btn-primary {
    padding: 14px 24px;
    font-size: 0.95rem;
  }



  .results-card {
    max-width: 100%;
  }
}