@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Syne:wght@400;600;700&display=swap');

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

:root {
  --bg: #0d0d1a;
  --surface: #13131f;
  --surface2: #1a1a2e;
  --border: rgba(79, 142, 247, 0.15);
  --border-hover: rgba(79, 142, 247, 0.35);
  --text: #e8e8f0;
  --text-muted: #6b6b8a;
  --accent: #4f8ef7;
  --accent-dim: rgba(79, 142, 247, 0.1);

  --red-bg: rgba(239, 68, 68, 0.08);
  --red-border: rgba(239, 68, 68, 0.3);
  --red-text: #f87171;
  --red-icon: #ef4444;

  --green-bg: rgba(34, 197, 94, 0.08);
  --green-border: rgba(34, 197, 94, 0.3);
  --green-text: #4ade80;
  --green-icon: #22c55e;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Syne', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(79, 142, 247, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 142, 247, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  box-shadow: 0 0 60px rgba(79, 142, 247, 0.06);
}

/* Header */
.header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.logo {
  margin-top: 4px;
  flex-shrink: 0;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--text);
}

.subtitle {
  margin-top: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.subtitle strong {
  color: var(--accent);
}

/* Input group */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-row {
  display: flex;
  gap: 10px;
}

input[type="number"] {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.12);
}

input[type="number"]::placeholder {
  color: var(--text-muted);
  font-size: 15px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

button:hover {
  opacity: 0.9;
}

button:active {
  transform: scale(0.97);
}

/* Result box */
.result {
  border-radius: 14px;
  padding: 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeIn 0.25s ease;
}

.result.hidden {
  display: none;
}

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

.result.danger {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
}

.result.success {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}

.result-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.result.danger .result-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-icon);
}

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

.result-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.result.danger .result-title { color: var(--red-text); }
.result.success .result-title { color: var(--green-text); }

.result-sub {
  margin-top: 3px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  opacity: 0.75;
}

.result.danger .result-sub { color: var(--red-text); }
.result.success .result-sub { color: var(--green-text); }

/* Info bar */
.info-bar {
  display: flex;
  justify-content: space-between;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  gap: 1rem;
}

.info-bar strong {
  color: var(--text);
}

/* Footer */
footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.04em;
}

/* Mobile */
@media (max-width: 420px) {
  .card {
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 16px;
  }
  h1 { font-size: 22px; }
  .input-row { flex-direction: column; }
  button { width: 100%; }
  .info-bar { flex-direction: column; gap: 4px; }
}
