/* 6AM Mail Setup - Professional UI (Option B) */
:root{
  --bg: #f5f7fb;
  --bg2: #eef2f8;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #5b677a;
  --border: rgba(15, 23, 42, .10);
  --shadow: 0 10px 30px rgba(16,24,40,.08);
  --accent: #d01000;
  --accent-2:#0b5fff;
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(1000px 500px at 20% 0%, rgba(208,16,0,.06), transparent 55%),
    radial-gradient(900px 500px at 80% 10%, rgba(11,95,255,.06), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{
  max-width: 1220px;
  margin: 22px auto;
  padding: 0 18px 28px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar-left{ display:flex; align-items:center; gap: 12px; min-width: 0; }
.logo{
  width: 74px; height: 44px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.brand{ min-width: 0; }
.brand-title{ font-weight: 750; letter-spacing: -.02em; }
.brand-sub{ color: var(--muted); font-size: 13px; margin-top: 2px; }

.topbar-right{ display:flex; align-items:center; gap: 10px; flex-wrap: wrap; justify-content:flex-end; }

.pill{
  display:flex; align-items:center; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15,23,42,.02);
  font-size: 13px;
}
.pill span{ color: var(--muted); }
.pill strong{ font-weight: 700; max-width: 260px; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang{
  display:flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow:hidden;
  background: #fff;
}
.lang-btn{
  font-size: 13px;
  padding: 8px 10px;
  color: var(--muted);
}
.lang-btn.active{
  color: #fff;
  background: var(--text);
}

.switch{
  display:flex;
  align-items:center;
  gap: 10px;
  user-select:none;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  color: var(--muted);
}
.switch input{ display:none; }
.switch-ui{
  width: 38px; height: 22px;
  border-radius: 999px;
  background: rgba(15,23,42,.14);
  position: relative;
  transition: .2s ease;
}
.switch-ui::after{
  content:"";
  position:absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(0,0,0,.16);
  transition: .2s ease;
}
.is-advanced .switch-ui{
  background: rgba(208,16,0,.85);
}
.is-advanced .switch-ui::after{ transform: translateX(16px); }
.switch-text{ font-weight: 650; color: var(--text); }

main{ margin-top: 14px; }

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.card + .card{ margin-top: 14px; }

.card-title h2{
  margin: 0;
  font-size: 18px;
  letter-spacing: -.01em;
}
.card-title .muted{ margin: 6px 0 0; }

.start{
  padding: 18px;
}
.start h1{
  margin: 0;
  font-size: 34px;
  letter-spacing: -.03em;
}
.lead{
  color: var(--muted);
  margin: 10px 0 14px;
  font-size: 15px;
  line-height: 1.4;
}

.start-form{
  display:grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items:center;
  margin-top: 6px;
}
.input{
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 15px;
  outline: none;
}
.input:focus{ border-color: rgba(208,16,0,.45); box-shadow: 0 0 0 4px rgba(208,16,0,.12); }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 10px 22px rgba(16,24,40,.10); }
.btn:active{ transform: translateY(0); }
.btn[disabled]{ opacity:.55; cursor:not-allowed; transform:none; box-shadow:none; }

.btn.primary{
  background: var(--accent);
  border-color: rgba(208,16,0,.1);
  color: #fff;
}
.btn.soft{
  background: rgba(15,23,42,.03);
}
.btn.ghost{
  background: transparent;
}
.btn.tiny{
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
}

.callouts{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.callout{
  border: 1px solid var(--border);
  background: rgba(15,23,42,.02);
  border-radius: 14px;
  padding: 12px;
}
.callout-title{ font-weight: 800; font-size: 12px; letter-spacing: .02em; text-transform: uppercase; }
.callout-text{ color: var(--muted); margin-top: 6px; line-height: 1.35; font-size: 13px; }

.micro{
  display:flex;
  flex-wrap: wrap;
  align-items:center;
  gap: 6px 10px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 13px;
}
.micro-k{ color: var(--muted); }
.micro-v{ color: var(--text); font-weight: 700; }
.dot{ opacity:.35; }

.columns{
  display:grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin-top: 14px;
  align-items:start;
}
.col{ display:flex; flex-direction:column; gap: 14px; min-width: 0; }

.muted{ color: var(--muted); font-size: 14px; line-height: 1.35; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.app-grid{
  display:grid;
  grid-template-columns: repeat( auto-fit, minmax(220px, 1fr) );
  gap: 12px;
  margin-top: 12px;
}

.app-card{
  text-align:left;
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  cursor:pointer;
  transition: .15s ease;
  min-width: 0;
}
.app-card:hover{ border-color: rgba(208,16,0,.25); box-shadow: 0 10px 22px rgba(16,24,40,.08); transform: translateY(-1px); }
.app-card.active{ border-color: rgba(208,16,0,.45); box-shadow: 0 10px 22px rgba(208,16,0,.10); }

.app-ico{
  width: 42px; height: 42px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(208,16,0,.10);
  color: var(--accent);
  font-weight: 900;
  font-size: 18px;
  flex: 0 0 auto;
}
.app-meta{ min-width: 0; }
.app-name{ font-weight: 800; letter-spacing: -.01em; }
.app-sub{ color: var(--muted); font-size: 13px; margin-top: 4px; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }

.quick-actions{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tabs{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tab{
  border: 1px solid var(--border);
  background: rgba(15,23,42,.02);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 750;
  cursor:pointer;
  font-size: 13px;
}
.tab.active{
  background: rgba(208,16,0,.10);
  border-color: rgba(208,16,0,.25);
  color: var(--accent);
}
.panels{ margin-top: 12px; }
.panel{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}
.panel + .panel{ margin-top: 10px; }

.js .panel{ display:none; }
.js .panel.active{ display:block; }

.panel h3{
  margin: 0 0 10px;
  font-size: 16px;
}
.steps{
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.5;
}
.steps li{ margin: 8px 0; }
.tip{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(11,95,255,.18);
  background: rgba(11,95,255,.06);
  color: var(--muted);
  font-size: 13px;
}

.kv{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-top: 12px;
}
.row{
  display:grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 10px;
  align-items:center;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.k{ font-weight: 800; font-size: 13px; }
.v{ min-width: 0; }
.v .mono{ font-weight: 800; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; display:block; }
.sub{ color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.25; }

.notice{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(208,16,0,.18);
  background: rgba(208,16,0,.06);
  color: var(--muted);
  font-size: 13px;
}

.settings-actions{
  display:flex;
  gap: 8px;
  justify-content:flex-end;
  margin-top: -6px;
}

.disclosure{
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15,23,42,.02);
  overflow:hidden;
}
.disclosure summary{
  cursor:pointer;
  padding: 12px;
  font-weight: 800;
  list-style:none;
}
.disclosure summary::-webkit-details-marker{ display:none; }
.disclosure-body{
  padding: 12px;
  border-top: 1px solid var(--border);
  background:#fff;
}

.qrbox{ display:flex; flex-direction:column; gap: 10px; align-items:flex-start; }
.qrbox img{ border-radius: 14px; border: 1px solid var(--border); background:#fff; }

.bullets{ margin: 10px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.4; }
.bullets li{ margin: 7px 0; }

.checklist{
  display:grid;
  gap: 10px;
  margin-top: 12px;
}
.check{
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}

.hero-media{
  border-radius: 16px;
  overflow:hidden;
  border: 1px solid var(--border);
  position:relative;
  background: #000;
}
.hero-media img{
  width: 100%;
  height: auto;
  display:block;
}
.hero-badge{
  position:absolute;
  left: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15,23,42,.65);
  color: #fff;
  backdrop-filter: blur(8px);
}
.hb-title{ font-weight: 900; letter-spacing: .02em; }
.hb-sub{ opacity: .9; font-size: 13px; margin-top: 2px; }

.footer{
  margin-top: 16px;
  text-align:center;
  color: var(--muted);
  font-size: 13px;
}

.advanced-only{ display:none; }
.is-advanced .advanced-only{ display:block; }

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(15,23,42,.92);
  color: #fff;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 20px 45px rgba(0,0,0,.22);
  opacity: 0;
  pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(-6px); }

.sr-only{
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0);
  white-space:nowrap; border:0;
}

/* Responsive */
@media (max-width: 980px){
  .columns{ grid-template-columns: 1fr; }
  .pill strong{ max-width: 180px; }
  .row{ grid-template-columns: 140px minmax(0,1fr) auto; }
}

@media (max-width: 640px){
  .start h1{ font-size: 26px; }
  .start-form{ grid-template-columns: 1fr; }
  .settings-actions{ justify-content:flex-start; }
  .callouts{ grid-template-columns: 1fr; }
  .row{ grid-template-columns: 1fr; }
  .row .btn.tiny{ justify-self: start; }
}
