/* ==========================================================================
   AI Social Manager — Auth pages (login + placeholder dashboard)
   Builds on the tokens, buttons, brand, phone and float styles in main.css.
   ========================================================================== */


/* LOGIN LAYOUT ------------------------------------------------------------- */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Brand panel */
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 36px clamp(32px, 5vw, 72px) 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(124, 92, 255, .16), rgba(255, 79, 216, .05) 55%, transparent);
}
.visual-copy { margin-top: clamp(20px, 6vh, 72px); }
.visual-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.4vw, 3.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.035em;
}
.visual-copy p { max-width: 380px; margin-top: 16px; color: var(--muted); font-size: 1.08rem; }

.visual-stage {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 320px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.visual-stage::before {
  content: "";
  position: absolute;
  inset: 8% 18% 0;
  background: radial-gradient(closest-side, rgba(124, 92, 255, .45), rgba(255, 79, 216, .15) 65%, transparent);
  filter: blur(40px);
}
.phone-demo { position: relative; width: clamp(220px, 19vw, 280px); margin-top: 14px; rotate: -4deg; }
.af-1 { left: 4%; top: 34%; }
.af-2 { right: 3%; top: 10%; animation-delay: -2.5s; }

/* Form panel */
.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 28px clamp(20px, 5vw, 64px) 24px;
}
.auth-top { display: flex; align-items: center; justify-content: flex-end; width: 100%; max-width: 460px; }
.brand-mobile { display: none; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; font-weight: 500; transition: color .2s; }
.back-link:hover { color: var(--text); }
.back-link .icon { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.back-link:hover .icon { transform: translateX(-3px); }

.auth-card {
  width: 100%;
  max-width: 460px;
  margin: auto 0;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: rise .7s var(--ease) both;
}
.auth-card h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.15; letter-spacing: -.025em; }
.auth-sub { margin-top: 8px; color: var(--muted); font-size: .98rem; }
.auth-form { display: grid; gap: 20px; margin-top: 30px; }

/* Free-trial note on the sign-up card */
.trial-note { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; border: 1px solid rgba(61, 220, 151, .3); border-radius: 12px; background: rgba(61, 220, 151, .09); color: var(--muted); font-size: .9rem; line-height: 1.4; }
.trial-note b { display: block; color: var(--green); font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.trial-ico { display: grid; flex: none; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(61, 220, 151, .16); color: var(--green); }
.trial-ico .icon { width: 19px; height: 19px; }
.name-row,
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.name-row .control input { padding-right: 16px; }
.name-row .field:last-child .control input { padding-left: 16px; }

.page-signup .auth-panel { overflow: auto; }
.page-signup .auth-card { margin: 16px 0; }
.page-signup .auth-form { gap: 14px; margin-top: 22px; }
.page-signup .control input { height: 48px; }


/* FORM CONTROLS ------------------------------------------------------------ */

.field label { display: block; margin-bottom: 8px; color: #dcdcf3; font-size: .86rem; font-weight: 600; }
.control { position: relative; }
.control .lead {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 19px;
  height: 19px;
  margin-top: -9.5px;
  color: var(--faint);
  pointer-events: none;
  transition: color .2s;
}
.control:focus-within .lead { color: #b9a8ff; }

.control input {
  width: 100%;
  height: 54px;
  padding: 0 48px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(0, 0, 0, .32);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.control input::placeholder { color: var(--faint); }
.control input:hover { border-color: rgba(255, 255, 255, .28); }
.control input:focus { border-color: var(--violet); background: rgba(0, 0, 0, .42); box-shadow: 0 0 0 4px rgba(124, 92, 255, .25); }
.control input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #121226 inset;
}
.control input:-webkit-autofill:focus { box-shadow: 0 0 0 1000px #121226 inset, 0 0 0 4px rgba(124, 92, 255, .25); }

.has-error input { border-color: #ff6b8b; }
.has-error input:focus { box-shadow: 0 0 0 4px rgba(255, 107, 139, .2); }

.eye {
  position: absolute;
  right: 8px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  border-radius: 10px;
  color: var(--faint);
  transition: color .2s, background .2s;
}
.eye:hover { color: var(--text); background: var(--surface-2); }
.eye .icon { width: 19px; height: 19px; }

.field-error { margin-top: 8px; color: #ff8fa8; font-size: .84rem; }
.field-hint { margin-top: 8px; color: var(--amber); font-size: .82rem; }

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 107, 139, .4);
  border-radius: 14px;
  background: rgba(255, 107, 139, .1);
  color: #ffc2cf;
  font-size: .92rem;
  line-height: 1.45;
  animation: shake .4s;
}
.form-alert .icon { width: 19px; height: 19px; margin-top: 1px; color: #ff6b8b; }

.check { position: relative; display: inline-flex; align-items: center; justify-self: start; gap: 12px; color: var(--muted); font-size: .92rem; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: rgba(0, 0, 0, .32);
  color: transparent;
  transition: background .2s, border-color .2s, color .2s;
}
.check .box svg { width: 14px; height: 14px; }
.check:hover .box { border-color: rgba(255, 255, 255, .32); }
.check input:checked + .box { border-color: transparent; background: var(--grad-btn); color: #fff; }
.check input:focus-visible + .box { outline: 2px solid var(--cyan); outline-offset: 3px; }

.btn-block { width: 100%; margin-top: 4px; }
.spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .spinner { display: inline-block; }

.auth-alt { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: .93rem; }
.auth-alt a { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; color: #fff; font-weight: 600; }
.auth-alt a .icon { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.auth-alt a:hover .icon { transform: translateX(3px); }
.auth-foot { margin-top: 24px; color: var(--faint); font-size: .82rem; }


/* MOTION & RESPONSIVE ------------------------------------------------------ */

@keyframes rise  { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .brand-mobile { display: inline-flex; }
  .auth-top { justify-content: space-between; }
}

@media (max-width: 520px) {
  .name-row,
  .field-row { grid-template-columns: 1fr; }
  .name-row .field:last-child .control input { padding-left: 48px; }
}

@media (max-width: 420px) {
  .auth-panel { padding-inline: 16px; }
  .auth-card { border-radius: 24px; }
}
