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

:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --border: #27272a;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --error: #ef4444;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 560px;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  font-size: 2rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-group {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.input-group:focus-within {
  border-color: var(--accent);
}

#url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.875rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  min-width: 0;
}

#url-input::placeholder {
  color: #52525b;
}

#shorten-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.875rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

#shorten-btn:hover {
  background: var(--accent-hover);
}

#shorten-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-spinner svg {
  display: block;
}

.error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding-left: 0.25rem;
}

.result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.result label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.625rem;
}

.result-row {
  display: flex;
  gap: 0.5rem;
}

#short-url {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--accent-hover);
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  min-width: 0;
}

#copy-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#copy-btn:hover {
  background: var(--accent-hover);
}

#copy-btn.copied {
  background: #22c55e;
}

footer {
  text-align: center;
  margin-top: 3rem;
}

footer p {
  color: #52525b;
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .input-group {
    flex-direction: column;
  }

  #shorten-btn {
    border-radius: 0;
  }

  .result-row {
    flex-direction: column;
  }
}
