*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --auth-bg:#F5F0E8;
  --auth-card:#ffffff;
  --auth-text:#3A2A1E;
  --auth-muted:#8A8564;
  --auth-border:#D6CEBF;
  --auth-primary:#6B4C35;
  --auth-primary-hover:#A0714F;
  --auth-accent:#A0714F;
  --auth-shadow:0 8px 40px rgba(58,42,30,0.10);
  --auth-error-bg:#fdf2f2;
  --auth-error-border:#f5c6c6;
  --auth-error-text:#c0392b;
  --auth-success-bg:#f2fdf5;
  --auth-success-border:#b8e8c8;
  --auth-success-text:#1d6a3a;
}
html[data-theme="dark"]{
  --auth-bg:#140f0d;
  --auth-card:#1f1713;
  --auth-text:#F3EADF;
  --auth-muted:#b8a99a;
  --auth-border:#3B2A1F;
  --auth-primary:#C9B99A;
  --auth-primary-hover:#E8DFD0;
  --auth-accent:#D8B28B;
  --auth-shadow:0 16px 50px rgba(0,0,0,0.35);
  --auth-error-bg:rgba(192,57,43,.16);
  --auth-error-border:rgba(245,198,198,.25);
  --auth-error-text:#ffb3b3;
  --auth-success-bg:rgba(29,106,58,.16);
  --auth-success-border:rgba(184,232,200,.25);
  --auth-success-text:#b8e8c8;
}
body.auth-page{
  font-family:'DM Sans',sans-serif;
  background:var(--auth-bg);
  color:var(--auth-text);
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:2rem;
}
.auth-shell{width:100%;max-width:520px}
.auth-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:.7rem;margin-bottom:1rem}
.theme-toggle{
  display:inline-flex;align-items:center;gap:.55rem;
  border:1px solid var(--auth-border);background:transparent;color:var(--auth-text);
  border-radius:999px;padding:.55rem .95rem;font:500 .82rem 'DM Sans',sans-serif;cursor:pointer;
}
.theme-toggle:hover{border-color:var(--auth-primary);color:var(--auth-primary)}
.pwa-install-btn{
  display:inline-flex;align-items:center;gap:.5rem;border:1px solid var(--auth-border);background:transparent;color:var(--auth-text);
  border-radius:999px;padding:.55rem .9rem;font:600 .8rem 'DM Sans',sans-serif;cursor:pointer;transition:all .2s
}
.pwa-install-btn[hidden]{display:none!important}
.pwa-install-btn:hover{border-color:var(--auth-primary);color:var(--auth-primary)}
.pwa-modal{position:fixed;inset:0;z-index:12000;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;padding:1rem;backdrop-filter:blur(4px)}
.pwa-modal-card{width:min(460px,100%);background:var(--auth-card);border:1px solid var(--auth-border);border-radius:22px;padding:1.5rem;position:relative;box-shadow:var(--auth-shadow)}
.pwa-modal-close{position:absolute;right:1rem;top:1rem;width:34px;height:34px;border-radius:50%;border:1px solid var(--auth-border);background:transparent;color:var(--auth-text);cursor:pointer}
.pwa-modal-icon{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;background:color-mix(in srgb,var(--auth-primary) 14%,transparent);color:var(--auth-primary);font-size:1.4rem;margin-bottom:1rem}
.pwa-modal-card h2{text-align:left;margin-bottom:.6rem}
.pwa-modal-card p,.pwa-ios-help{font-size:.88rem;line-height:1.7;color:var(--auth-muted)}
.pwa-ios-help{margin-top:1rem;padding:.8rem 1rem;border-radius:12px;background:color-mix(in srgb,var(--auth-primary) 8%,transparent);border:1px solid var(--auth-border)}
.pwa-install-steps{margin:.55rem 0 0 1.15rem;padding:0}
.pwa-install-steps li{margin:.35rem 0}
.pwa-modal-actions{display:flex;justify-content:flex-end;gap:.75rem;flex-wrap:wrap;margin-top:1.25rem}
.pwa-modal-actions .btn,.pwa-modal-actions .btn-outline,.pwa-modal-actions .btn-primary{width:auto;margin-top:0;padding:.75rem 1.25rem;border-radius:999px}
.pwa-modal-actions .btn-outline{background:transparent;color:var(--auth-primary);border:1px solid var(--auth-border);cursor:pointer}
.pwa-modal-actions .btn-primary{background:var(--auth-primary);color:var(--auth-bg);border:0;cursor:pointer}
.card{background:var(--auth-card);border-radius:20px;padding:2.8rem;width:100%;box-shadow:var(--auth-shadow);border:1px solid var(--auth-border)}
.logo{text-decoration:none;display:block;text-align:center;margin-bottom:.7rem}
.logo img{display:inline-block;height:50px;width:auto;max-width:100%}
html[data-theme="dark"] .logo img{filter:brightness(0) invert(1)}
.subtitle{text-align:center;font-size:.85rem;color:var(--auth-muted);margin-bottom:2rem}
.plan-badge{display:inline-block;background:var(--auth-primary);color:var(--auth-bg);font-size:.72rem;padding:.2rem .7rem;border-radius:100px;letter-spacing:.05em;margin-left:.4rem}
h2{font-family:'Cormorant Garamond',serif;font-size:1.8rem;font-weight:400;text-align:center;color:var(--auth-text);margin-bottom:1.5rem}
.badge{text-align:center;font-size:.7rem;text-transform:uppercase;letter-spacing:.12em;color:var(--auth-accent);background:rgba(160,113,79,.12);padding:.3rem .9rem;border-radius:100px;display:inline-block;margin:0 auto .75rem;width:100%}
.alert{padding:.9rem 1.1rem;border-radius:10px;font-size:.85rem;margin-bottom:1.2rem}
.alert-error{background:var(--auth-error-bg);border:1px solid var(--auth-error-border);color:var(--auth-error-text)}
.alert-success{background:var(--auth-success-bg);border:1px solid var(--auth-success-border);color:var(--auth-success-text)}
.form-group,.fg{margin-bottom:1.1rem}
label{display:block;font-size:.82rem;font-weight:500;color:var(--auth-text);margin-bottom:.4rem;letter-spacing:.02em}
label span{color:var(--auth-accent)}
input{
  width:100%;padding:.75rem 1rem;border:1.5px solid var(--auth-border);border-radius:10px;
  font-family:'DM Sans',sans-serif;font-size:.9rem;color:var(--auth-text);background:transparent;outline:none;
  transition:border-color .2s,box-shadow .2s;
}
input:focus{border-color:var(--auth-primary);box-shadow:0 0 0 3px rgba(201,185,154,0.14)}
.phone-field{display:grid;grid-template-columns:minmax(170px,.8fr) minmax(0,1fr);gap:.65rem}
.phone-field select{
  width:100%;padding:.75rem .85rem;border:1.5px solid var(--auth-border);border-radius:10px;
  font-family:'DM Sans',sans-serif;font-size:.88rem;color:var(--auth-text);background:transparent;outline:none;
}
.phone-field select:focus{border-color:var(--auth-primary);box-shadow:0 0 0 3px rgba(201,185,154,0.14)}
.field-hint,.password-feedback{font-size:.76rem;line-height:1.5;color:var(--auth-muted);margin-top:.45rem}
.password-field{position:relative}
.password-field input{padding-right:3rem}
.password-toggle{position:absolute;right:.45rem;top:50%;transform:translateY(-50%);width:38px;height:38px;border:0;border-radius:50%;background:transparent;color:var(--auth-muted);cursor:pointer;display:grid;place-items:center}
.password-toggle:hover{color:var(--auth-primary);background:color-mix(in srgb,var(--auth-primary) 10%,transparent)}
.strength-meter{display:grid;grid-template-columns:repeat(3,1fr);gap:.35rem;margin-top:.6rem}
.strength-meter span{height:5px;border-radius:999px;background:color-mix(in srgb,var(--auth-muted) 18%,transparent)}
.strength-meter[data-strength="weak"] span:nth-child(1){background:#e74c3c}
.strength-meter[data-strength="medium"] span:nth-child(-n+2){background:#f39c12}
.strength-meter[data-strength="strong"] span{background:#2ecc71}
.password-feedback[data-state="weak"]{color:#e74c3c}
.password-feedback[data-state="medium"]{color:#f39c12}
.password-feedback[data-state="strong"]{color:#2ecc71}
.btn{
  display:block;width:100%;padding:.9rem;border-radius:100px;background:var(--auth-primary);color:var(--auth-bg);
  font-family:'DM Sans',sans-serif;font-size:.9rem;font-weight:500;border:none;cursor:pointer;transition:all .25s;margin-top:1.5rem;letter-spacing:.03em;
}
.btn:hover{background:var(--auth-primary-hover);color:#1f1713}
html[data-theme="light"] .btn:hover{color:var(--auth-bg)}
.forgot,.register-link a,.login-link a{
  color:var(--auth-primary);
  text-decoration:underline;
  text-decoration-color:color-mix(in srgb, var(--auth-primary) 45%, transparent);
  text-underline-offset:3px;
  font-weight:500;
  transition:color .2s,text-decoration-color .2s;
}
.forgot:hover,.register-link a:hover,.login-link a:hover{
  color:var(--auth-primary-hover);
  text-decoration-color:var(--auth-primary-hover);
}
.forgot{display:inline-flex;margin-top:.55rem;font-size:.82rem}
.login-link{text-align:center;font-size:.82rem;color:var(--auth-muted);margin-top:1.2rem}
.register-link{text-align:left;font-size:.82rem;color:var(--auth-muted);margin-top:1.2rem}
.divider{border:none;border-top:1px solid var(--auth-border);margin:1.2rem 0}
.helper-card{
  margin-top:1.3rem;padding:1.15rem 1.2rem;border:1px solid var(--auth-border);
  border-radius:16px;background:color-mix(in srgb,var(--auth-card) 86%, var(--auth-bg));
}
.helper-card h3{
  font:600 1rem 'DM Sans',sans-serif;
  color:var(--auth-text);
  margin:0 0 .5rem;
}
.helper-card p,.helper-note{
  color:var(--auth-muted);
  font-size:.88rem;
  line-height:1.6;
}
.helper-form{margin-top:.85rem}
.helper-actions{
  display:flex;flex-wrap:wrap;gap:.85rem;
  margin-top:1.25rem;
}
.btn.btn-secondary{
  background:transparent;
  color:var(--auth-primary);
  border:1.5px solid var(--auth-border);
  margin-top:.8rem;
}
.btn.btn-secondary:hover{
  background:var(--auth-primary);
  color:var(--auth-bg);
  border-color:var(--auth-primary);
}
.status-card{
  text-align:center;
}
.status-card .status-icon{
  width:64px;height:64px;border-radius:50%;
  display:grid;place-items:center;
  background:rgba(160,113,79,.14);
  color:var(--auth-primary);
  margin:0 auto 1rem;
  font-size:1.4rem;
}
@media(max-width:560px){
  .phone-field{grid-template-columns:1fr}
}
