/* ============================================================
   MyWeb Hosting Domain Panel — style.css
   ============================================================ */

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

:root {
  --c-bg:        #ffffff;
  --c-bg2:       #f7f7f5;
  --c-bg3:       #f0efea;
  --c-text:      #1a1a1a;
  --c-text2:     #6b6b6b;
  --c-text3:     #a0a09a;
  --c-border:    rgba(0,0,0,0.12);
  --c-border2:   rgba(0,0,0,0.2);
  --c-green:     #3B6D11;
  --c-green-bg:  #EAF3DE;
  --c-amber:     #854F0B;
  --c-amber-bg:  #FAEEDA;
  --c-blue:      #185FA5;
  --c-blue-bg:   #E6F1FB;
  --c-red:       #A32D2D;
  --c-red-bg:    #FCEBEB;
  --radius:      8px;
  --radius-lg:   12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg:      #1c1c1a;
    --c-bg2:     #242422;
    --c-bg3:     #2c2c2a;
    --c-text:    #f0efea;
    --c-text2:   #9a9a94;
    --c-text3:   #6b6b65;
    --c-border:  rgba(255,255,255,0.1);
    --c-border2: rgba(255,255,255,0.18);
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg3);
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  background: var(--c-bg);
  border-bottom: 0.5px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar-brand {
  flex: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-back {
  font-size: 13px;
  color: var(--c-text2);
  text-decoration: none;
  min-width: 100px;
}
.topbar-back:hover { color: var(--c-text); }

/* ── Container ──────────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ── Login page ─────────────────────────────────────────── */
.login-page { background: var(--c-bg3); }
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-logo {
  margin-bottom: 1.5rem;
  text-align: center;
}
.site-logo {
  height: 150px;
  width: auto;
  display: inline-block;
  object-fit: contain;
}
.topbar-brand .site-logo {
  height: 70px;
}
.card {
  background: var(--c-bg);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 380px;
}
.card-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 1.5rem;
  text-align: center;
}
.login-note {
  font-size: 12px;
  color: var(--c-text3);
  text-align: center;
  margin-top: 1rem;
}

/* ── Form fields ────────────────────────────────────────── */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--c-text2);
  margin-bottom: 4px;
  font-weight: 500;
}
.field input, .field select {
  width: 100%;
  padding: 9px 11px;
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--c-bg);
  color: var(--c-text);
  appearance: none;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.12);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { color: var(--c-text3); font-weight: 400; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--c-bg);
  color: var(--c-text);
  text-decoration: none;
  transition: background 0.1s;
}
.btn:hover { background: var(--c-bg2); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--c-text);
  color: var(--c-bg);
  border-color: var(--c-text);
}
.btn-primary:hover { opacity: 0.85; background: var(--c-text); }
.btn-full { width: 100%; justify-content: center; padding: 10px; }
.btn-ghost { background: none; border-color: transparent; color: var(--c-text2); font-size: 13px; }
.btn-ghost:hover { background: var(--c-bg2); color: var(--c-text); }
.btn-outline { background: var(--c-bg); border-color: var(--c-border2); }
.btn-preset {
  font-size: 12px;
  padding: 5px 12px;
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg2);
  color: var(--c-text2);
  cursor: pointer;
}
.btn-preset:hover { background: var(--c-bg3); color: var(--c-text); }

/* ── Alerts & messages ──────────────────────────────────── */
.alert {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 1rem;
}
.alert-error { background: var(--c-red-bg); color: var(--c-red); }

.msg {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin: 0.75rem 0;
  display: none;
}
.msg-ok    { display: block; background: var(--c-green-bg); color: var(--c-green); }
.msg-error { display: block; background: var(--c-red-bg);   color: var(--c-red); }
.msg-info  { display: block; background: var(--c-blue-bg);  color: var(--c-blue); }

/* ── Page heading ───────────────────────────────────────── */
.page-head { margin-bottom: 1rem; }
.page-head h2 { font-size: 18px; font-weight: 500; }

/* ── Search ─────────────────────────────────────────────── */
.search-wrap { margin-bottom: 1rem; }
.input-search {
  width: 100%;
  padding: 9px 12px;
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--c-bg);
  color: var(--c-text);
}
.input-search:focus { outline: none; border-color: var(--c-blue); }

/* ── Domain list ────────────────────────────────────────── */
.domain-card {
  background: var(--c-bg);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.domain-name  { font-size: 15px; font-weight: 500; }
.domain-meta  { font-size: 12px; color: var(--c-text2); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.domain-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius);
}
.badge-active  { background: var(--c-green-bg); color: var(--c-green); }
.badge-expiring, .badge-warn { background: var(--c-amber-bg); color: var(--c-amber); }
.badge-expired { background: var(--c-red-bg); color: var(--c-red); }

/* ── Overview card ──────────────────────────────────────── */
.overview-card {
  background: var(--c-bg2);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.ov-domain { font-size: 17px; font-weight: 500; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.ov-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ov-item   {}
.ov-label  { font-size: 11px; color: var(--c-text2); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.ov-value  { font-size: 13px; font-weight: 500; }
.ov-ns     { font-size: 12px; line-height: 1.7; }

/* ── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 0.5px solid var(--c-border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}
.tab.active { color: var(--c-text); border-bottom-color: var(--c-text); }
.tab:hover  { color: var(--c-text); }

/* ── Tab pane ───────────────────────────────────────────── */
.tab-pane {}
.tab-desc { font-size: 13px; color: var(--c-text2); margin-bottom: 1.25rem; line-height: 1.6; }

/* ── NS presets ─────────────────────────────────────────── */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 1rem;
}
.preset-label { font-size: 12px; color: var(--c-text2); font-weight: 500; }

/* ── Contact type tabs ──────────────────────────────────── */
.sync-option { border: 0.5px solid var(--c-border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 1.25rem; }
.sync-label { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--c-text); }
.sync-label input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; accent-color: var(--c-text); }
.contact-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.25rem; }
.ctab {
  font-size: 12px;
  padding: 5px 12px;
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius);
  cursor: pointer;
  background: none;
  color: var(--c-text2);
  font-weight: 500;
}
.ctab.active { background: var(--c-bg2); color: var(--c-text); border-color: var(--c-border2); }

/* ── Transfer lock ──────────────────────────────────────── */
.lock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 0.5px solid var(--c-border);
  margin-bottom: 1rem;
  gap: 16px;
}
.lock-title { font-size: 15px; font-weight: 500; }
.lock-sub   { font-size: 13px; color: var(--c-text2); margin-top: 2px; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--c-border2);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .slider { background: #1D9E75; }
input:checked + .slider::before { transform: translateX(18px); }

/* ── EPP ────────────────────────────────────────────────── */
.epp-row { display: flex; gap: 8px; flex-wrap: wrap; }
.epp-row input {
  flex: 1;
  min-width: 200px;
  padding: 9px 11px;
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius);
  font-size: 14px;
  letter-spacing: 2px;
  background: var(--c-bg2);
  color: var(--c-text);
  font-family: monospace;
}
.info-box {
  background: var(--c-bg2);
  border: 0.5px solid var(--c-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--c-text2);
  line-height: 1.6;
  margin-top: 1rem;
}

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--c-text);
  color: var(--c-bg);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Misc ───────────────────────────────────────────────── */
.loading { color: var(--c-text2); font-size: 14px; padding: 2rem 0; text-align: center; }
.empty   { color: var(--c-text2); font-size: 14px; padding: 2rem 0; text-align: center; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .domain-card { flex-direction: column; align-items: flex-start; }
  .domain-actions { width: 100%; justify-content: space-between; }
  .ov-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .epp-row { flex-direction: column; }
  .epp-row input { min-width: unset; width: 100%; }
}
