/* =========================================================
   WAVYS AI — AUTH DESIGN SYSTEM
   Shared across login / signup / forgot / reset.
   Light, professional, calm. One consistent identity.
   ========================================================= */

:root{
  /* Brand */
  --brand-50:  #eef1ff;
  --brand-100: #e0e4ff;
  --brand-500: #6366f1;
  --brand-600: #5850ec;   /* primary */
  --brand-700: #4840d4;   /* hover / pressed */

  /* Canvas */
  --bg:        #f6f8fc;
  --panel:     #ffffff;

  /* Ink */
  --text:      #0f172a;
  --muted:     #5b6577;
  --faint:     #8a93a6;

  /* Lines */
  --border:    #e5e9f0;
  --border-2:  #d8dee8;

  /* Status */
  --green:   #16a34a;
  --green-bg:#ecfdf3;
  --red:     #dc2626;
  --red-bg:  #fef2f2;
  --amber:   #b45309;
  --amber-bg:#fffbeb;

  /* Shape */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --ring: 0 0 0 4px rgba(88,80,236,.18);
  --shadow-card: 0 1px 2px rgba(15,23,42,.04), 0 12px 32px -12px rgba(15,23,42,.14);
}

*{ box-sizing: border-box; }

html, body{ height: 100%; margin: 0; }

body{
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

/* =========================================================
   LAYOUT — split panel on desktop, centered on mobile
   ========================================================= */
.auth{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 940px){
  .auth{ grid-template-columns: 1.05fr 1fr; }
}

/* --- Brand / marketing panel (desktop only) --- */
.auth-aside{
  display: none;
  position: relative;
  overflow: hidden;
  padding: 56px;
  color: #fff;
  background:
    radial-gradient(120% 120% at 0% 0%, #6c63ff 0%, transparent 55%),
    radial-gradient(120% 120% at 100% 100%, #4840d4 0%, transparent 50%),
    linear-gradient(160deg, #4a43d6 0%, #322c9c 100%);
}

@media (min-width: 940px){
  .auth-aside{ display: flex; flex-direction: column; justify-content: space-between; }
}

.auth-aside::after{
  /* soft wave texture */
  content:"";
  position:absolute;
  inset:0;
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 1px, transparent 1px 22px);
  opacity:.6;
  pointer-events:none;
}

.auth-aside .aside-top{ position: relative; z-index: 1; }

.auth-aside .brand{
  display:flex; align-items:center; gap:12px;
  font-weight:700; font-size:16px; letter-spacing:-.01em;
}

.auth-aside .aside-hero{ position: relative; z-index: 1; max-width: 420px; }
.auth-aside .aside-hero h2{
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 16px;
}
.auth-aside .aside-hero p{
  font-size: 15.5px;
  color: rgba(255,255,255,.82);
  margin: 0;
}

.auth-aside .aside-points{
  position:relative; z-index:1;
  display:grid; gap:14px; margin: 28px 0 0; padding:0; list-style:none;
}
.auth-aside .aside-points li{
  display:flex; align-items:flex-start; gap:12px;
  font-size: 14.5px; color: rgba(255,255,255,.9);
}
.auth-aside .aside-points svg{ flex:0 0 20px; margin-top:1px; }

.auth-aside .aside-foot{
  position:relative; z-index:1;
  font-size: 13px; color: rgba(255,255,255,.7);
}

/* --- Form side --- */
.auth-main{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-card{
  width: 100%;
  max-width: 420px;
}

/* Brand mark shown above form on mobile / small screens */
.auth-brand{
  display:flex;
  align-items:center;
  gap: 12px;
  justify-content:center;
  margin-bottom: 26px;
}
@media (min-width: 940px){
  .auth-brand{ display:none; }
}
/* Solo layout (forgot/reset): brand always visible, single centered column */
.auth-solo{ grid-template-columns: 1fr !important; }
.auth-solo .auth-brand{ display:flex !important; }

.brand-mark{
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--brand-500), var(--brand-700));
  color:#fff;
  display:grid; place-items:center;
  box-shadow: 0 6px 16px -6px rgba(88,80,236,.6);
}
.brand-mark svg{ width: 26px; height: 26px; }
.brand-name{ font-weight: 700; font-size: 17px; letter-spacing: -.01em; }

.auth-head{ margin-bottom: 24px; }
.auth-head h1{
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}
.auth-head p{
  font-size: 14.5px;
  color: var(--muted);
  margin: 0;
}

/* =========================================================
   FORM ELEMENTS
   ========================================================= */
.field{ margin-bottom: 16px; }

label{
  display:block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.input{
  width: 100%;
  height: 44px;
  padding: 0 13px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input{ height:auto; padding:11px 13px; resize:vertical; }
.input::placeholder{ color: var(--faint); }
.input:hover{ border-color: #c3ccda; }
.input:focus{
  outline: none;
  border-color: var(--brand-600);
  box-shadow: var(--ring);
}
.input[aria-invalid="true"],
.input.error{ border-color: var(--red); }
.input.error:focus{ box-shadow: 0 0 0 4px rgba(220,38,38,.14); }

.field-error{
  display:block;
  min-height: 16px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--red);
}

.field-hint{
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* Password field with visibility toggle */
.input-wrap{ position: relative; }
.input-wrap .input{ padding-right: 44px; }
.reveal-btn{
  position:absolute; right:6px; top:50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  display:grid; place-items:center;
  border:none; background:transparent; cursor:pointer;
  color: var(--faint); border-radius: 8px;
}
.reveal-btn:hover{ color: var(--muted); background: var(--brand-50); }
.reveal-btn:focus-visible{ outline:none; box-shadow: var(--ring); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn{
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--brand-600);
  background: var(--brand-600);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:hover{ background: var(--brand-700); border-color: var(--brand-700); }
.btn:focus-visible{ outline:none; box-shadow: var(--ring); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity: .55; cursor: not-allowed; transform:none; }
.btn.is-loading{ color: transparent; position: relative; }
.btn.is-loading::after{
  content:""; position:absolute; width:18px; height:18px;
  border: 2px solid rgba(255,255,255,.5); border-top-color:#fff;
  border-radius:50%; animation: spin .7s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.btn-block-gap{ margin-top: 22px; }

/* =========================================================
   MESSAGES
   ========================================================= */
.msg{
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 16px;
  min-height: 18px;
  text-align: center;
}
.msg.ok, .msg.success{ color: var(--green); }
.msg.err, .msg.error{ color: var(--red); }

/* forgot/reset use base class .message */
.message{
  font-size: 13.5px;
  margin-top: 14px;
  min-height: 18px;
  color: var(--muted);
}
.message.success{ color: var(--green); }
.message.error{ color: var(--red); }

/* =========================================================
   LINKS / DIVIDER / FOOTER
   ========================================================= */
.row-between{ display:flex; justify-content: space-between; align-items:center; }
.row-end{ display:flex; justify-content:flex-end; margin: 4px 0 2px; }

.link{
  color: var(--brand-600);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.link:hover{ color: var(--brand-700); text-decoration: underline; }

.divider{ height:1px; background: var(--border); margin: 22px 0 18px; }

.fineprint{
  text-align:center;
  font-size: 13.5px;
  color: var(--muted);
}

.back-link{
  display:inline-flex; align-items:center; gap:6px;
  margin-top: 20px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}
.back-link:hover{ color: var(--text); }

/* =========================================================
   PROMO / BANNER
   ========================================================= */
.promo{
  display:flex; gap:12px; align-items:flex-start;
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  color: #14532d;
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 22px;
}
.promo svg{ flex:0 0 18px; margin-top:2px; color: var(--green); }
.promo strong{ display:block; font-size: 13.5px; }
.promo span{ font-size: 12.5px; color:#3f6b4f; }

/* =========================================================
   TERMS ROW (signup)
   ========================================================= */
.terms-row{
  display:flex; align-items:flex-start; gap:11px;
  margin: 6px 0 4px;
}
.terms-row input[type="checkbox"]{
  width:18px; height:18px; margin-top:2px; flex:0 0 18px;
  accent-color: var(--brand-600); cursor:pointer;
}
.terms-text{ font-size: 13px; color: var(--text); line-height:1.5; }
.terms-hint{ font-size: 12px; color: var(--faint); margin-top:2px; }
.tlink{ color: var(--brand-600); font-weight:600; text-decoration:none; }
.tlink:hover{ text-decoration:underline; }

/* =========================================================
   LEGAL MODAL (signup)
   ========================================================= */
.modal-backdrop{
  position: fixed; inset: 0; z-index: 100;
  display: none;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  padding: 20px;
  align-items: center; justify-content: center;
}
.modal-backdrop.open{ display:flex; }

.modal{
  width: 100%; max-width: 640px;
  max-height: 86vh;
  display:flex; flex-direction:column;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(2,6,23,.28);
  overflow: hidden;
}
.modal-head{
  display:flex; align-items:center; justify-content: space-between; gap:12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title{ font-size: 15px; font-weight: 700; }
.modal-actions{ display:flex; gap:8px; }
.chip{
  height: 34px; padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: #fff; color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover{ background: #f6f8fc; color: var(--text); }
.chip.primary{ background: var(--brand-600); border-color: var(--brand-600); color:#fff; }
.chip.primary:hover{ background: var(--brand-700); }
.modal-body{
  padding: 18px;
  overflow-y: auto;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}
.modal-body h3,
.modal-body h4{ color: var(--text); margin: 18px 0 6px; font-size: 14.5px; font-weight: 700; }
.modal-body h3:first-child, .modal-body p:first-child{ margin-top: 0; }
.modal-body ul{ margin: 6px 0; padding-left: 18px; }
.modal-body li{ margin: 6px 0; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:13px; color: var(--muted); }
