@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Syne:wght@600;700;800&display=swap');

:root {
  --ink: #102a32;
  --ink-soft: #3d5a63;
  --paper: #f4fbff;
  --surface: rgba(255, 255, 255, 0.72);
  --line: rgba(16, 42, 50, 0.12);
  --teal: #0f8f8a;
  --teal-deep: #0b6e6a;
  --flame: #e85d2c;
  --flame-deep: #c9471a;
  --mint: #d8fff4;
  --sky: #ccefff;
  --shadow: 0 18px 50px rgba(16, 42, 50, 0.1);
  --radius: 18px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--sky), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, var(--mint), transparent 55%),
    linear-gradient(160deg, #eef9ff 0%, #f7fffb 45%, #fff8f1 100%);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(16, 42, 50, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 42, 50, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

a {
  color: var(--teal-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0 0.4rem;
  animation: rise 0.7s ease both;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.brand span {
  color: var(--teal);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  color: var(--ink);
}

.nav .user-chip {
  color: var(--teal-deep);
  font-weight: 600;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  padding: 0.75rem 1.15rem;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--flame);
  color: white;
  box-shadow: 0 10px 24px rgba(232, 93, 44, 0.28);
}

.btn-primary:hover {
  background: var(--flame-deep);
}

.btn-secondary {
  background: rgba(15, 143, 138, 0.12);
  color: var(--teal-deep);
}

.btn-secondary:hover {
  background: rgba(15, 143, 138, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.btn-danger {
  background: rgba(196, 60, 40, 0.12);
  color: #9e2b1a;
}

.hero {
  min-height: calc(100vh - 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0 4rem;
  animation: rise 0.85s 0.05s ease both;
}

.hero-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 10vw, 6.4rem);
  letter-spacing: -0.055em;
  line-height: 0.92;
  margin: 0 0 1rem;
  color: var(--ink);
}

.hero-brand span {
  color: var(--teal);
}

.hero-line {
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
  line-height: 1.5;
}

.search-bar {
  display: flex;
  gap: 0.65rem;
  width: min(720px, 100%);
  padding: 0.45rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: float-in 0.9s 0.15s ease both;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.85rem 1.1rem;
  color: var(--ink);
}

.search-bar .btn {
  border-radius: 999px;
  padding-inline: 1.4rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  padding: 1.4rem;
}

.page {
  padding: 1.5rem 0 4rem;
  animation: rise 0.7s ease both;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
  margin: 0 0 0.35rem;
}

.page-sub {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  max-width: 40rem;
}

.results {
  margin-top: 2rem;
  display: grid;
  gap: 0.9rem;
}

.result {
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  transition: transform 0.15s ease, border-color 0.15s ease;
  animation: rise 0.5s ease both;
}

.result:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 143, 138, 0.35);
}

.result h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.result h3 a {
  color: var(--ink);
  text-decoration: none;
}

.result h3 a:hover {
  color: var(--teal-deep);
}

.result .url {
  color: var(--teal);
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  word-break: break-all;
}

.result p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.muted {
  color: var(--ink-soft);
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='url'],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  font: inherit;
  color: var(--ink);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(15, 143, 138, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 143, 138, 0.12);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.alert-error {
  background: rgba(196, 60, 40, 0.1);
  color: #8f2a1a;
}

.alert-ok {
  background: rgba(15, 143, 138, 0.12);
  color: var(--teal-deep);
}

.split {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  min-height: 60vh;
}

.mail-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mail-nav button,
.mail-nav a {
  text-align: left;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
}

.mail-nav button.active,
.mail-nav a.active,
.mail-nav button:hover,
.mail-nav a:hover {
  background: rgba(15, 143, 138, 0.12);
  color: var(--ink);
}

.mail-list {
  display: grid;
  gap: 0.45rem;
}

.mail-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.mail-item:hover {
  border-color: rgba(15, 143, 138, 0.35);
  transform: translateX(2px);
}

.mail-item.unread {
  background: rgba(204, 239, 255, 0.55);
  font-weight: 600;
}

.mail-item .meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
}

.mail-view h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.mail-view .meta-row {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.mail-body {
  white-space: pre-wrap;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.hint {
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-weight: 400;
}

.footer {
  padding: 2rem 0 2.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 143, 138, 0.12);
  color: var(--teal-deep);
}

.status-pending_dns {
  background: rgba(232, 93, 44, 0.12);
  color: var(--flame-deep);
}

.status-verified {
  background: rgba(15, 143, 138, 0.14);
  color: var(--teal-deep);
}

.status-mail_active {
  background: rgba(16, 42, 50, 0.1);
  color: var(--ink);
}

.dns-grid {
  display: grid;
  gap: 0.75rem;
}

.dns-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.dns-type {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--teal);
}

.dns-card code {
  font-size: 0.92rem;
  word-break: break-all;
}

.check-row {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  margin-bottom: 0.4rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

.check-row.ok {
  border-color: rgba(15, 143, 138, 0.35);
  background: rgba(216, 255, 244, 0.55);
}

.check-row.wait {
  border-color: rgba(232, 93, 44, 0.28);
  background: rgba(255, 244, 236, 0.7);
}

.perm-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.perm-list li {
  margin-bottom: 0.35rem;
}

.ai-page {
  padding-bottom: 2rem;
}

.ai-shell {
  display: flex;
  flex-direction: column;
  min-height: min(70vh, 720px);
  max-width: 820px;
}

.ai-chat {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0 1rem;
  max-height: 52vh;
}

.ai-bubble {
  max-width: min(92%, 640px);
  padding: 0.9rem 1.05rem;
  border-radius: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  animation: rise 0.35s ease both;
}

.ai-bubble.assistant {
  align-self: flex-start;
  background: rgba(204, 239, 255, 0.65);
  border: 1px solid rgba(15, 143, 138, 0.18);
}

.ai-bubble.user {
  align-self: flex-end;
  background: rgba(232, 93, 44, 0.12);
  border: 1px solid rgba(232, 93, 44, 0.22);
}

.ai-cite {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.ai-composer {
  display: flex;
  gap: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.ai-composer input {
  flex: 1;
}

@media (max-width: 800px) {
  .split,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .search-bar {
    border-radius: 18px;
    flex-direction: column;
  }

  .search-bar .btn {
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding-top: 3rem;
  }

  .ai-composer {
    flex-direction: column;
  }
}
