/* ===== Reset & Base ===== */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a2e;
  background: #fafafa;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #1d4ed8;
}

/* ===== Layout - Free floating feel ===== */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}

/* ===== Header ===== */
.site-header {
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 16px;
  color: #1a1a2e;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-name {
  letter-spacing: -0.2px;
}

.brand-mark {
  color: #2563eb;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
}

.site-nav-link {
  color: #64748b;
  font-weight: 500;
  font-size: 13.5px;
  padding: 6px 0;
  position: relative;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav-link:hover {
  color: #1a1a2e;
}

.site-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #2563eb;
  border-radius: 1px;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-nav-link:hover::after {
  width: 100%;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn--primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.btn--primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn--ghost {
  background: transparent;
  color: #475569;
  border-color: rgba(0, 0, 0, 0.12);
}

.btn--ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.2);
  color: #1a1a2e;
}

.btn--ghost--external {
  color: #64748b;
  border-color: rgba(0, 0, 0, 0.1);
}

.btn--ghost--external:hover {
  color: #1a1a2e;
  border-color: rgba(0, 0, 0, 0.2);
}

.btn--large {
  padding: 12px 22px;
  font-size: 15px;
}

/* ===== Hero Section ===== */
.hero {
  padding: 30px 0 60px;
  text-align: center;
}

.hero-inner {
  max-width: 680px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero-title {
  font-size: 40px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0f172a;
  margin: 0 0 16px;
}

.hero-body {
  font-size: 16px;
  color: #64748b;
  max-width: 540px;
  margin: 0 auto 30px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== Section Styles ===== */
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #0f172a;
  margin: 0 0 12px;
}

.section-title--center {
  text-align: center;
}

.section-body {
  color: #64748b;
  font-size: 15px;
  max-width: 560px;
}

.section-body--center {
  text-align: center;
  margin: 0 auto;
}

/* ===== Services Section ===== */
.services {
  padding: 50px 0 30px;
}

.site-header--dark .section-title {
  color: #f1f5f9;
}

.site-header--dark .section-body {
  color: #94a3b8;
}

.site-header--dark .services {
  background: #0f172a;
  border-radius: 16px;
  padding: 50px 24px;
  margin: 0 24px 30px;
}

.site-header--dark .tools {
  background: #0f172a;
  border-radius: 16px;
  padding: 40px 24px;
  margin: 0 24px 30px;
}

.site-header--dark .signin-cta {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

.site-header--dark .signin-cta .section-title {
  color: #f1f5f9;
}

.site-header--dark .signin-cta .section-body {
  color: #94a3b8;
}

.site-header--dark .service-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

.site-header--dark .service-card:hover {
  background: #334155;
  border-color: rgba(59, 130, 246, 0.3);
}

.site-header--dark .tool-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}

.site-header--dark .tool-card:hover {
  background: #334155;
  border-color: rgba(59, 130, 246, 0.3);
}

.site-header--dark .service-title {
  color: #f1f5f9;
}

.site-header--dark .service-body {
  color: #94a3b8;
}

.site-header--dark .service-link {
  color: #60a5fa;
}

.site-header--dark .service-link:hover {
  color: #93bbfc;
}

.site-header--dark .tool-title {
  color: #f1f5f9;
}

.site-header--dark .tool-desc {
  color: #64748b;
}

.site-header--dark .tools {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.site-header--dark .signin-cta-actions .btn--ghost--external {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.15);
}

.site-header--dark .signin-cta-actions .btn--ghost--external:hover {
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.35);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
}

.service-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(37, 99, 235, 0.2);
}

.service-icon {
  color: #2563eb;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
}

.service-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #0f172a;
}

.service-body {
  font-size: 13.5px;
  color: #64748b;
  margin: 0 0 16px;
  line-height: 1.55;
}

.service-link {
  font-size: 13.5px;
  font-weight: 500;
  color: #2563eb;
}

.service-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ===== Tools Section ===== */
.tools {
  padding: 40px 0 30px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

@media (max-width: 880px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .tools-grid { grid-template-columns: 1fr; }
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  border-color: rgba(37, 99, 235, 0.15);
}

.tool-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}

.tool-desc {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
}

/* ===== Sign In CTA ===== */
.signin-cta {
  padding: 40px 0 20px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  margin-top: 20px;
  text-align: center;
}

.signin-cta-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ===== Dark mode variants (landing page) ===== */
.site-header--dark {
  background: #0f172a;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.site-header--dark .brand,
.site-header--dark .brand-name {
  color: #f1f5f9;
}

.site-header--dark .brand-mark {
  color: #3b82f6;
}

.site-header--dark .site-nav-link {
  color: #94a3b8;
}

.site-header--dark .site-nav-link:hover {
  color: #f1f5f9;
}

.site-header--dark .site-nav-link::after {
  background: #3b82f6;
}

.site-header--dark .btn--ghost {
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

.site-header--dark .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.site-header--dark .btn--primary {
  background: #3b82f6;
  border-color: #3b82f6;
}

.site-header--dark .btn--primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.site-header--dark .btn--ghost--external {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.15);
}

.site-header--dark .btn--ghost--external:hover {
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.35);
}

.site-footer--dark {
  background: #0f172a;
  border-top-color: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.site-footer--dark .footer-brand {
  color: #f1f5f9;
}

.site-footer--dark .footer-nav a {
  color: #94a3b8;
}

.site-footer--dark .footer-nav a:hover {
  color: #f1f5f9;
}

.site-footer--dark .footer-legal {
  color: #64748b;
}

.site-footer--dark .footer-legal a:hover {
  color: #f1f5f9;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 28px 24px;
  background: #fff;
  color: #94a3b8;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: #0f172a;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
}

.footer-nav a:hover {
  color: #0f172a;
}

.footer-legal {
  margin: 0;
  font-size: 12.5px;
  color: #94a3b8;
}

.footer-legal a:hover {
  color: #0f172a;
}

/* ===== Auth nav (injected when signed in) ===== */
.auth-nav:not(.site-actions) {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Only plain links. Exclude .btn so the shared header container
   (which gets the .auth-nav class from auth.js) never overrides the
   Sign in / Create account button colours. */
.auth-nav a:not(.btn) {
  color: #64748b;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-nav a:not(.btn):hover {
  color: #1a1a2e;
}

.auth-nav a.auth-cta {
  color: #2563eb;
  font-weight: 600;
}

.auth-nav .auth-user {
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 500;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-nav .auth-signout {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-nav .auth-signout:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.2);
  color: #1a1a2e;
}

.site-header--dark .auth-nav .auth-user {
  color: #f1f5f9;
}

.site-header--dark .auth-nav .auth-signout {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.15);
}

.site-header--dark .auth-nav .auth-signout:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* ===== Account / Auth Pages ===== */
.auth-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 28px;
  max-width: 420px;
  margin: 40px auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.auth-card h1 {
  font-size: 22px;
  margin: 0 0 8px;
  color: #0f172a;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.auth-tabs button {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  padding: 10px 16px;
  margin-bottom: -1px;
  font: inherit;
  cursor: pointer;
  color: #64748b;
  font-weight: 500;
  border-radius: 6px 6px 0 0;
  transition: all 0.15s ease;
}

.auth-tabs button:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.02);
}

.auth-tabs button[aria-selected="true"] {
  background: #fff;
  color: #0f172a;
  font-weight: 600;
}

.auth-card label {
  display: block;
  margin: 12px 0 5px;
  font-weight: 500;
  font-size: 13px;
  color: #475569;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  border-radius: 6px;
  background: #f8f9fa;
  transition: all 0.15s ease;
}

.auth-card input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-submit {
  width: 100%;
  padding: 11px;
  margin-top: 18px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-submit:hover {
  background: #1d4ed8;
}

.auth-google {
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  color: #475569;
  transition: all 0.15s ease;
}

.auth-google:hover {
  background: #f8f9fa;
  border-color: rgba(0, 0, 0, 0.2);
}

.auth-message {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
}

.auth-message.error { color: #dc2626; }
.auth-message.success { color: #16a34a; }

.auth-hint {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 6px 0;
}

.auth-forgot-link {
  color: #2563eb;
  font-size: 13px;
  font-weight: 500;
}

.auth-forgot-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ===== Tool Pages (simple tools) ===== */
.container {
  width: 100%;
  max-width: 720px;
  margin: 40px auto;
  padding: 0 20px;
}

.tool-box {
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 24px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.tool-box h1 {
  font-size: 24px;
  margin: 0 0 10px;
  color: #0f172a;
}

.tool-box p {
  color: #64748b;
  margin: 0 0 14px;
}

.tool-box h2 {
  font-size: 16px;
  margin-top: 24px;
  color: #0f172a;
}

.tool-box ol, .tool-box ul {
  margin: 8px 0 16px 20px;
  color: #475569;
}

.tool-box li {
  margin: 4px 0;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 500;
  font-size: 13px;
  color: #475569;
}

input[type="file"],
input[type="text"],
textarea,
select {
  max-width: 100%;
}

input[type="text"],
textarea,
select {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  border-radius: 6px;
  background: #f8f9fa;
  transition: all 0.15s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

button {
  padding: 10px 18px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  transition: all 0.15s ease;
}

button:hover {
  background: #1d4ed8;
}

.actions {
  margin-top: 16px;
}

.status {
  min-height: 22px;
  margin: 12px 0;
  font-size: 14px;
  color: #64748b;
}

.result {
  margin-top: 14px;
}

.result a {
  color: #2563eb;
  font-weight: 500;
}

.faq {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 30px;
  padding-top: 14px;
}

.faq dt {
  font-weight: 600;
  margin-top: 14px;
  color: #0f172a;
  font-size: 14px;
}

.faq dd {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13.5px;
}

/* ===== Ads ===== */
.ad-728,
.ad-468,
.ad-160 {
  display: block;
  margin: 20px auto;
}

.ad-728 {
  max-width: 728px;
  min-height: 90px;
}

.ad-468 {
  max-width: 468px;
  min-height: 60px;
}

.ad-160 {
  max-width: 160px;
  min-height: 300px;
  width: 160px;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .ad-728,
  .ad-468,
  .ad-160 { display: none; }
}

.tool-box-with-ad {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.tool-box-with-ad .tool-box {
  flex: 1;
  min-width: 0;
}

@media (max-width: 720px) {
  .tool-box-with-ad {
    flex-direction: column;
  }

  .tool-box-with-ad .ad-160 {
    width: 100%;
    max-width: 160px;
    margin: 0 auto 14px;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .main {
    padding: 50px 18px 40px;
  }

  .site-header {
    padding: 16px 18px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-body {
    font-size: 15px;
  }

  .services-grid,
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .site-nav {
    display: none;
  }

  .hero-title {
    font-size: 28px;
  }

  .services-grid,
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
