/* Shared styles for the nestwork sign-up and login pages */
:root {
  --accent: #86CD96;
  --accent-dark: #2D6B43;
  --peach: #DDF1E2;
  --ink: #1F2933; --dark: #3E6B88;
  --muted: #67737E;
  --line: #E1E7EC;
  --soft: #F1F5F8;
  --bg: #EEF2F5;
  --error: #C2283A;
  --ok: #1C6B37;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 14px; line-height: 1.5; }
a { color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; max-width: 1280px; margin: 0 auto; }
.panel { flex: 1 1 380px; max-width: 460px; background: var(--dark); color: #FFFFFF; border-radius: 28px; padding: 36px; display: flex; flex-direction: column; gap: 40px; position: relative; overflow: hidden; }
.panel::after { content: ''; position: absolute; right: -90px; bottom: -90px; width: 260px; height: 260px; border-radius: 999px; border: 44px solid #4A7592; }
.form-side { flex: 999 1 480px; min-width: 0; background: #FFFFFF; border-radius: 28px; padding: 36px; display: flex; flex-direction: column; }

/* Brand panel */
.brand { display: flex; align-items: center; gap: 10px; color: #FFFFFF; text-decoration: none; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark { display: flex; }
.brand-mark svg { display: block; }
.wm { color: #C4EDCD; }
.panel h1 { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.panel h1 span { color: #C4EDCD; }
.panel .lead { color: #E1ECF3; margin-top: 12px; font-size: 15px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 1; }
.step { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px; color: #E1ECF3; transition: background-color .3s ease, color .3s ease; }
.step-dot { width: 34px; height: 34px; flex: none; border-radius: 999px; border: 1.5px solid #4A5863; display: grid; place-items: center; font-size: 13px; font-weight: 700; transition: background-color .3s ease, border-color .3s ease, color .3s ease, transform .3s ease; }
.step strong { display: block; font-size: 14px; font-weight: 600; }
.step small { font-size: 12px; color: #A7C0D0; }
.step.current { background: #4E7A96; color: #FFFFFF; }
.step.current .step-dot { border-color: var(--accent); color: var(--accent); transform: scale(1.05); }
.step.done { color: #FFFFFF; }
.step.done .step-dot { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.panel-foot { margin-top: auto; font-size: 13px; color: #A7C0D0; position: relative; z-index: 1; }

/* Mobile progress */
.mobile-top { display: none; }
.progress { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress span { display: block; height: 100%; width: 20%; background: var(--accent); border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* Form side */
.topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; margin-bottom: 24px; }
.back { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: #FFFFFF; font-weight: 600; font-size: 13px; transition: background-color .2s ease, transform .15s ease; }
.back:hover { background: var(--soft); }
.back[hidden] { display: none; }
.login { font-size: 13px; color: var(--muted); margin-left: auto; }
.login a { font-weight: 600; }
.stage { width: 100%; max-width: 460px; margin: auto; padding: 12px 0 24px; }
.screen { display: none; }
.screen.active { display: block; animation: enter .45s cubic-bezier(.2,.7,.2,1); }
.screen.active.from-left { animation-name: enter-left; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); }
.screen h2 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; }
.screen .sub { color: var(--muted); margin-top: 8px; font-size: 15px; }
.fields { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .group-label { font-size: 13px; font-weight: 600; }
.control { position: relative; }
.input { width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #FFFFFF; font-size: 15px; outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.input::placeholder { color: #8C99A4; }
.input:hover { border-color: #CCD5DC; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(134,205,150,.15); }
.input[aria-invalid="true"] { border-color: var(--error); }
.input.with-btn { padding-right: 64px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232B2725' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }
.reveal { position: absolute; right: 6px; top: 6px; height: 38px; padding: 0 12px; border: none; border-radius: 10px; background: var(--soft); font-size: 12px; font-weight: 700; transition: background-color .2s ease; }
.reveal:hover { background: #E2E8ED; }
.error { font-size: 12px; color: var(--error); min-height: 0; }
.error:empty { display: none; }
.hint { font-size: 12px; color: var(--muted); }

.strength { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.strength i { height: 5px; border-radius: 999px; background: var(--soft); transition: background-color .3s ease; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--error); }
.strength[data-level="2"] i:nth-child(-n+2) { background: #E2BD2F; }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--accent); }
.strength[data-level="4"] i { background: #3FA46A; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--dark); flex: none; }

.btn { width: 100%; height: 52px; border-radius: 999px; border: none; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, opacity .2s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--dark); color: #FFFFFF; }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(31,41,51,.22); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { box-shadow: 0 10px 24px rgba(134,205,150,.35); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--muted); height: 44px; font-weight: 600; }
.btn-ghost:hover { color: var(--ink); }
.btn-outline { background: #FFFFFF; border: 1.5px solid var(--line); color: var(--ink); }
.btn-outline:hover { background: var(--soft); }
.btn svg { transition: transform .2s ease; }
.btn:hover svg.arrow { transform: translateX(3px); }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.divider { display: flex; align-items: center; gap: 12px; color: #8C99A4; font-size: 12px; margin: 4px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
button:focus-visible, a:focus-visible, .chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Code input */
.code { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 28px; }
.code input { width: 100%; height: 60px; text-align: center; font-size: 24px; font-weight: 700; border-radius: 14px; border: 1.5px solid var(--line); outline: none; background: #FFFFFF; transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease, background-color .2s ease; }
.code input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(134,205,150,.15); }
.code input.filled { background: var(--soft); transform: scale(1.03); }
.resend { margin-top: 16px; font-size: 13px; color: var(--muted); }
.link-btn { border: none; background: none; padding: 0; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:disabled { color: #8C99A4; text-decoration: none; cursor: default; }
.email-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--peach); color: var(--ink); font-weight: 600; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: none; margin: 0; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; z-index: 1; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: 13px; transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease; }
.chip:hover span { border-color: #CCD5DC; }
.chip input:checked + span { background: var(--dark); border-color: var(--dark); color: #FFFFFF; }
.chip input:active + span { transform: scale(.95); }

/* Invites */
.invite-row { display: flex; gap: 8px; }
.invite-row .input { flex: 1 1 auto; min-width: 0; }
.add-btn { flex: none; width: 50px; height: 50px; border-radius: 14px; border: none; background: var(--dark); color: var(--accent); display: grid; place-items: center; transition: transform .15s ease; }
.add-btn:active { transform: scale(.92); }
.invites { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.invite { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 16px; background: var(--soft); animation: pop .35s cubic-bezier(.2,.8,.2,1); }
.invite .avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--peach); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; text-transform: uppercase; }
.invite span.mail { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.remove { width: 36px; height: 36px; flex: none; border-radius: 999px; border: none; background: #FFFFFF; display: grid; place-items: center; transition: background-color .2s ease; }
.remove:hover { background: #FDE4E4; color: var(--error); }
.empty { font-size: 13px; color: var(--muted); padding: 14px; border: 1.5px dashed var(--line); border-radius: 16px; text-align: center; }

/* Success */
.success { text-align: center; }
.badge { width: 96px; height: 96px; margin: 0 auto 24px; border-radius: 999px; background: var(--accent); display: grid; place-items: center; animation: pop .6s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 0 12px var(--peach); }
.badge path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .35s ease forwards; }
.summary { margin: 28px 0 0; padding: 0; list-style: none; text-align: left; border-radius: 20px; background: var(--soft); }
.summary li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; border-top: 1px solid #E2E8ED; }
.summary li:first-child { border-top: none; }
.summary span { color: var(--muted); }
.summary strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.spinner { width: 18px; height: 18px; border-radius: 999px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #FFFFFF; animation: spin .7s linear infinite; }

@keyframes enter { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes enter-left { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.7); } 70% { opacity: 1; transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.shake { animation: shake .4s ease; }
.panel, .form-side { animation: rise .6s cubic-bezier(.2,.7,.2,1) backwards; }
.form-side { animation-delay: 80ms; }

@media (max-width: 900px) {
  .shell { padding: 12px; gap: 12px; align-content: flex-start; }
  .panel { max-width: none; flex-basis: 100%; padding: 24px; gap: 20px; flex-direction: row; align-items: center; justify-content: space-between; border-radius: 24px; }
  .panel .intro, .panel .steps, .panel-foot { display: none; }
  .panel::after { width: 160px; height: 160px; border-width: 28px; right: -60px; bottom: -80px; }
  .mobile-top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
  .mobile-top .label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
  .mobile-top .label strong { color: var(--ink); }
  .form-side { padding: 24px 20px; border-radius: 24px; }
  .topline { margin-bottom: 12px; }
}
@media (max-width: 420px) {
  .screen h2 { font-size: 24px; }
  .code { gap: 6px; }
  .code input { height: 52px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .badge path { stroke-dashoffset: 0; }
}
