/* Account pages: log in, register, password recovery, email confirmation and
   the legal-status notice. Tokens and fonts come from theme.css. */

body{
  min-height:100vh;
  background:radial-gradient(circle at 50% 12%,#f1e8ff 0,rgba(248,244,255,0.7) 23%,#fff 51%) no-repeat #fff;
}

a{color:inherit}

.auth-top{
  position:absolute;
  top:0;
  left:0;
  right:0;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:26px 34px 0;
}

.back-link{
  color:#5e397f;
  font-size:13px;
  font-weight:700;
  text-decoration:none;
}

.back-link::before{content:'← '}

.back-link:hover{text-decoration:underline}

.nav-action{
  margin-left:auto;
  height:38px;
  padding:0 14px;
  display:inline-flex;
  align-items:center;
  border:1px solid #ddd4e7;
  border-radius:6px;
  background:#fff;
  color:#30283a;
  font-size:12px;
  font-weight:700;
  text-decoration:none;
  transition:border-color .18s,color .18s;
}

.nav-action:hover{border-color:var(--purple);color:var(--purple)}

.auth-shell{
  position:relative;
  min-height:100vh;
  padding:84px 24px 70px;
  display:grid;
  place-items:start center;
}

.auth-panel{
  width:100%;
  max-width:650px;
  text-align:center;
}

.auth-logo{display:inline-flex}

.auth-logo img{display:block;width:166px;height:44px;object-fit:contain}

.auth-title{
  max-width:640px;
  margin:40px auto 12px;
  font-size:46px;
  line-height:1.06;
  font-weight:800;
}

.auth-title em{font-style:normal;color:var(--purple-2)}

.auth-copy{
  max-width:520px;
  margin:0 auto;
  color:#4f4a54;
  font-size:16px;
  line-height:1.6;
}

.auth-form{
  max-width:510px;
  margin:32px auto 0;
  padding:35px 40px;
  display:flex;
  flex-direction:column;
  gap:16px;
  text-align:left;
  border:1px solid var(--border);
  border-radius:8px;
  background:rgba(255,255,255,0.84);
  box-shadow:var(--shadow-card);
}

.auth-form > .auth-copy{
  max-width:none;
  padding:13px 16px;
  border-left:3px solid var(--purple-2);
  background:var(--surface2);
  color:#51485a;
  font-size:14px;
}

.field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.field-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.field label,.field-label{
  color:#322a3c;
  font-size:13px;
  font-weight:700;
}

.field-link{
  color:#5f2b84;
  font-size:12px;
  font-weight:600;
  text-decoration:underline;
  text-underline-offset:2px;
}

.field input{
  width:100%;
  height:48px;
  padding:0 14px;
  border:1px solid #c6bdcf;
  border-radius:8px;
  background:#fff;
  color:var(--ink);
  font-size:15px;
  font-weight:500;
  outline:none;
  transition:border-color .18s,box-shadow .18s;
}

.field input::placeholder{color:#9a92a1}

.field input:focus{
  border-color:var(--purple);
  box-shadow:var(--focus-ring);
}

.field input:disabled{
  background:#f6f3f9;
  color:var(--ink-3);
  cursor:not-allowed;
}

.field.has-error input{
  border-color:#ba3a54;
  box-shadow:0 0 0 3px rgba(186,58,84,0.1);
}

.password-wrap{position:relative}

.password-wrap input{padding-right:72px}

.password-toggle{
  position:absolute;
  top:50%;
  right:8px;
  transform:translateY(-50%);
  min-width:52px;
  height:32px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#5f2b84;
  font-size:12px;
  font-weight:700;
  transition:background .18s;
}

.password-toggle:hover{background:var(--surface2)}

.field-error{
  color:var(--red);
  font-size:12px;
  line-height:1.4;
}

.field-error:empty{display:none}

.check-row{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:6px 10px;
  color:#4c4650;
  font-size:13px;
  line-height:1.55;
}

.check-row input{
  width:16px;
  height:16px;
  margin-top:3px;
  accent-color:var(--purple);
  flex-shrink:0;
}

.check-row > span:first-of-type{flex:1;min-width:0}

.check-row .field-error{flex-basis:100%}

.check-row a{
  color:#5f2b84;
  text-decoration:underline;
  text-underline-offset:2px;
}

.auth-submit{
  width:100%;
  height:52px;
  margin-top:4px;
  border:0;
  border-radius:8px;
  background:var(--plum-3);
  color:#fff;
  font-size:16px;
  font-weight:800;
  transition:background .18s;
}

.auth-submit:hover{background:#7a2b91}

.auth-submit:disabled{
  opacity:.6;
  cursor:not-allowed;
}

.auth-submit:disabled:hover{background:var(--plum-3)}

.form-message{
  display:none;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  color:#4c4650;
  font-size:13px;
  line-height:1.55;
  text-align:left;
}

.form-message.show{display:block}
.form-message.success{border-color:rgba(22,130,93,0.35);background:var(--green-dim);color:#0f6548}
.form-message.error{border-color:rgba(168,39,66,0.35);background:var(--red-dim);color:var(--red)}
.form-message.info{border-color:rgba(116,72,201,0.3);background:var(--surface2);color:#51306f}

.auth-panel > .form-message{max-width:510px;margin:28px auto 0}

.auth-alt{
  max-width:510px;
  margin:24px auto 0;
  color:#4c4650;
  font-size:14px;
  line-height:1.6;
}

.auth-alt a{
  color:#5f2b84;
  font-weight:600;
  text-decoration:underline;
  text-underline-offset:2px;
}

.strength{
  display:flex;
  align-items:center;
  gap:10px;
}

.strength-track{
  flex:1;
  height:5px;
  border-radius:99px;
  overflow:hidden;
  background:#e9e2f0;
}

.strength-fill{
  width:0;
  height:100%;
  background:#ba3a54;
  transition:width .18s,background .18s;
}

.strength-fill.ok{background:#d19a1c}
.strength-fill.good{background:#2eb875}

.strength-label{
  min-width:72px;
  color:var(--ink-3);
  font-size:12px;
}

/* Legal-status notice */
.status-list{
  max-width:510px;
  margin:32px auto 0;
  padding:8px 40px;
  text-align:left;
  border:1px solid var(--border);
  border-radius:8px;
  background:rgba(255,255,255,0.84);
  box-shadow:var(--shadow-card);
}

.status-list section{padding:24px 0}

.status-list section + section{border-top:1px solid var(--border)}

.status-list h2{margin-bottom:8px;font-size:19px;font-weight:800}

.status-list .auth-copy{max-width:none;font-size:15px}

/* Published legal documents (rendered by assets/js/legal.js) */
/* The panel is a grid item: without this a wide table widens the page. */
.auth-panel[data-legal-state="published"]{min-width:0;max-width:100%}

[data-legal-state="published"] .status-list{max-width:760px}

.legal-version{margin-bottom:16px;color:var(--ink-3);font-size:13px;font-weight:700}

.legal-document{color:var(--ink-2);font-size:15px;line-height:1.65;overflow-wrap:break-word}

.legal-document h2,
.legal-document h3,
.legal-document h4{margin:26px 0 8px;color:var(--ink);font-size:16px;font-weight:800}

.legal-document h2:first-child{margin-top:0}

.legal-document p{margin:0 0 12px}

.legal-document ul,
.legal-document ol{margin:0 0 12px;padding-left:22px}

.legal-document li{margin-bottom:6px}

.legal-document hr{margin:20px 0;border:0;border-top:1px solid var(--border)}

.legal-document table{display:block;width:100%;margin:0 0 14px;overflow-x:auto;border-collapse:collapse;font-size:14px}

.legal-document th,
.legal-document td{min-width:120px;padding:8px 10px;border:1px solid var(--border);text-align:left;vertical-align:top}

.legal-document code{font-size:13px}

.legal-source{margin-top:18px;color:var(--ink-3);font-size:12px;overflow-wrap:anywhere}

@media (max-width:680px){
  .auth-top{padding:20px 20px 0}

  .auth-shell{padding:76px 20px 55px}

  .auth-logo img{width:145px;height:38px}

  .auth-title{
    margin-top:30px;
    font-size:34px;
  }

  .auth-copy{font-size:15px}

  .auth-form{
    margin-top:27px;
    padding:27px 22px;
  }

  .status-list{padding:4px 22px}
}
