/* students_signup.css
   Page-specific styles that build on your design-tokens + main.css.
   Put in static/css/auth/students_signup.css
*/

/* Prefer tokens defined in design-tokens.css, fall back when missing */
:root{
  --sg-max-width: var(--max-width, 980px);
  --sg-gap: var(--space-xl, 2rem);
  --sg-gutter: var(--space-md, 1rem);
  --sg-radius-lg: var(--radius-lg, 12px);
  --sg-radius-md: var(--radius-md, 8px);
  --sg-border: var(--border, #e6e9ef);
  --sg-surface: var(--surface, #fff);
  --sg-muted: var(--muted, #666666);
  --sg-primary: var(--primary, #0b5cff);
  --sg-shadow: var(--shadow-1, 0 6px 20px rgba(16,24,40,0.06));
  --sg-focus: 0 0 0 3px rgba(11,92,255,0.12);
}

/* Outer wrapper */
.signup-wrap{
  max-width: var(--sg-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--sg-gutter);
  padding-right: var(--sg-gutter);
}

/* Grid layout */
.signup-grid{
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: var(--sg-gap);
  align-items: start;
}

/* Illustration */
.signup-illus{
  position: relative;
  border-radius: var(--sg-radius-lg);
  overflow: hidden;
  min-height: 380px;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
  box-shadow: var(--sg-shadow);
  transition: transform 220ms ease;
}
.signup-illus img{ width:100%; height:100%; object-fit:cover; display:block; aspect-ratio:16/10; }
.signup-illus::after{
  content:"";
  position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.22));
  pointer-events:none;
}
.illus-overlay{
  position:absolute; left:1rem; bottom:1rem; color: #fff; z-index:2;
  text-shadow: 0 6px 18px rgba(0,0,0,0.6);
}
.illus-overlay strong{ display:block; font-weight:700; font-size:1.25rem; }
.illus-overlay span{ display:block; font-size:0.95rem; opacity:0.95; }

/* Card */
.signup-card{
  background: var(--sg-surface);
  border-radius: var(--sg-radius-lg);
  border: 1px solid var(--sg-border);
  box-shadow: 0 6px 18px rgba(11,92,255,0.03);
  overflow: hidden;
  display:flex;
  flex-direction:column;
}
/* slightly reduced padding to make the card feel lighter */
.signup-card .card-body{ padding: clamp(0.9rem, 2.0vw, 1.4rem); }

/* Headings & copy */
#signup-heading{ color: var(--sg-primary); font-weight:600; margin-bottom:0.35rem; }
.signup-card p{ color: var(--sg-muted); margin-bottom: 1rem; }

/* Form field wrapper (floating label pattern) */
.form-field{
  position: relative;
  margin-bottom: 0.85rem; /* tighten vertical rhythm */
}

/* Inputs */
.form-field .form-control{
  width: 100%;
  padding: 1rem 0.9rem 0.6rem 0.9rem; /* top padding makes room for floating label effect */
  font-size: 0.98rem;
  border-radius: var(--sg-radius-md);
  border: 1px solid rgba(16,24,40,0.06);
  background: transparent;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
  outline: none;
}

/* subtle placeholder */
.form-field .form-control::placeholder{
  color: color-mix(in srgb, var(--sg-muted) 70%, transparent); /* fallback where supported */
  opacity: 0.8;
  font-style: normal;
}

/* label positioned above input (floating) */
.form-field .form-label{
  position: absolute;
  left: 0.9rem;
  top: 1.05rem;
  transform-origin: left center;
  transition: transform 0.14s ease, top 0.14s ease, font-size 0.14s ease, color 0.14s ease;
  background: transparent;
  padding: 0 0.2rem;
  color: var(--sg-muted);
  pointer-events: none;
  font-size: 0.95rem;
  line-height: 1;
}

/* When input has content or is focused, lift the label */
.form-field .form-control:focus + .form-label,
.form-field .form-control:not(:placeholder-shown) + .form-label{
  top: -0.5rem;
  transform: translateY(0) scale(0.92);
  color: var(--sg-primary);
  font-weight:600;
  background: var(--sg-surface);
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

/* Focus style */
.form-field .form-control:focus{
  box-shadow: var(--sg-focus);
  border-color: color-mix(in srgb, var(--sg-primary) 55%, transparent);
}

/* ----- Compact two-column row (name + email) ----- */
.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

/* make small/compact buttons */
.btn-small {
  padding: 0.4rem 0.6rem;
  font-size: 0.88rem;
  border-radius: 8px;
}

/* optional collapsible area */
.optional-collapsible { margin-bottom: 0.75rem; }
.collapsible-panel { margin-top: 0.6rem; }

/* smaller helper text */
.signup-card .form-text.small { font-size: 0.85rem; margin-top: 0.25rem; color: var(--sg-muted); }

/* smaller consent row */
.small-consent .form-check-label { font-size: 0.92rem; }

/* Inline controls for password toggle + strength */
.input-group-inline{
  margin-top: 0.5rem;
  display:flex;
  gap:0.5rem;
  align-items:center;
  flex-wrap:wrap;
}
.btn.btn-ghost{
  background: transparent;
  border: 1px solid rgba(16,24,40,0.06);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-ghost:focus{ box-shadow: var(--sg-focus); }
.pw-strength{ color: var(--sg-muted); font-size:0.9rem; }

/* ----- Password strength visual (label + bar) ----- */
.pw-meter {
  display:flex;
  gap:0.6rem;
  align-items:center;
  margin-top:0.45rem;
}
.pw-meter .pw-strength { font-weight:600; font-size:0.9rem; min-width:64px; text-transform:capitalize; }
.pw-meter .pw-bar {
  flex:1;
  height:8px;
  border-radius:6px;
  background: rgba(0,0,0,0.06);
  overflow:hidden;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02);
}
.pw-bar > i {
  display:block;
  height:100%;
  width:0%;
  border-radius:6px;
  transition: width 180ms ease, background 180ms ease;
}

/* color classes (map pw-0 -> weak -> red ... pw-5 -> strong -> green) */
.pw-0 .pw-bar > i { background: #d64545; width: 16%; }   /* very weak */
.pw-1 .pw-bar > i { background: #e07a4d; width: 32%; }   /* weak */
.pw-2 .pw-bar > i { background: #e6b04d; width: 48%; }   /* okay */
.pw-3 .pw-bar > i { background: #b5c256; width: 64%; }   /* good */
.pw-4 .pw-bar > i { background: #6bb26b; width: 82%; }   /* strong */
.pw-5 .pw-bar > i { background: #37b24d; width: 100%; }  /* excellent */

/* give the strength label a neutral color by default, individual classes may override */
.pw-strength { color: var(--sg-muted); }
.pw-0 .pw-strength { color: #d64545; }
.pw-1 .pw-strength { color: #e07a4d; }
.pw-2 .pw-strength { color: #e6b04d; }
.pw-3 .pw-strength { color: #6b6b2b; }
.pw-4 .pw-strength { color: #2e8b2e; }
.pw-5 .pw-strength { color: #1f7a2f; }

/* errors under fields */
.form-text.text-danger{ color: var(--danger, #bd2c00); margin-top:0.375rem; font-size:0.875rem; }

/* checkbox row uses main.css defaults but ensure spacing */
.form-check{ margin: 0.75rem 0; display:flex; gap:0.5rem; align-items:flex-start; }
.form-check-input{ width:1.05rem; height:1.05rem; margin-top:0.15rem; }

/* submit */
.form-actions{ margin-top: 1rem; padding-top: 0.6rem; border-top: 1px solid rgba(16,24,40,0.03); }
.btn-primary{
  background: var(--btn-bg, var(--sg-primary));
  color: var(--btn-text, #fff);
  border: none;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  width: 100%;
}
.btn-primary:focus{ box-shadow: var(--sg-focus); }
.btn-primary:hover{ transform: translateY(-2px); transition: transform .12s ease; }

/* footer small */
.signup-card .card-footer{ border-top: 1px solid rgba(0,0,0,0.04); padding: 0.75rem 1rem; color: var(--sg-muted); text-align:center; font-size:0.85rem; }

/* Responsive */
@media (max-width: 980px){
  .signup-grid{ grid-template-columns: 1fr 400px; }
}
@media (max-width: 900px){
  .signup-grid{ grid-template-columns: 1fr; gap: 1.25rem; }
  .signup-illus{ height:263px; min-height:0; aspect-ratio:16/9; }
  .signup-card{ margin-top: -44px; position: relative; z-index: 3; box-shadow: var(--sg-shadow); }
  .input-group-inline{ width:100%; justify-content: space-between; }
  .illus-overlay span{ display:block; font-size:0.95rem; opacity:0.95; margin-bottom: 10px;}

}
@media (max-width: 700px) {
  .form-row.two-col { grid-template-columns: 1fr; gap: 0.5rem; }
}
@media (max-width: 420px){
  .signup-illus{ height:150px; min-height:0; aspect-ratio:16/9; }
  .signup-card .card-body{ padding: 0.8rem; }
  .form-field .form-control{ padding: 0.8rem 0.75rem 0.5rem 0.75rem; }
  .form-field .form-label{ left: 0.75rem; top: 1rem; }
}

/* Accessibility & reduced motion */
:focus{ outline: none; }
@media (prefers-reduced-motion: reduce){
  .signup-illus, .signup-card, .btn-primary{ transition: none !important; }
}

/* ----- helper & consent text fixes (signup page) ----- */

/* Make generic helper text inside the signup card match the design tokens */
.signup-card .form-text {
  color: var(--sg-muted);
  font-size: 0.90rem;
  line-height: 1.35;
  margin-top: 0.35rem;
}

/* Make inline <code> examples less intrusive and consistent with helper text */
.signup-card .form-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
  font-size: 0.88rem;
  padding: 0.06rem 0.28rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.03);
  color: inherit; /* inherit muted color so it looks subtle */
  white-space: nowrap;
}

/* Style the checkbox label (consent) to match helper text and wrap cleanly */
.signup-card .form-check-label {
  color: var(--sg-muted);
  font-size: 0.95rem;
  line-height: 1.4;
  margin-left: 0;        /* avoid unexpected gaps */
  display: block;        /* ensures long copy wraps beneath the label text, not to the side */
  cursor: pointer;
}

/* Keep the checkbox and label aligned: move the label left slightly and add gap */
.signup-card .form-check {
  gap: 0.65rem;          /* spacing between checkbox and label */
  align-items: flex-start;
}

/* Ensure no additional global rule (e.g., .text-muted) is overriding important contrast.
   If you still see differences, increase specificity temporarily:
*/
.signup-card .form-text,
.signup-card .form-check-label {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Small responsive tweak so very long consent copy doesn't overflow on tiny screens */
@media (max-width: 420px) {
  .signup-illus{ height:193px; min-height:0; aspect-ratio:16/9; }
  .signup-card .form-check-label { font-size: 0.92rem; }
  .signup-card .form-text { font-size: 0.88rem; }
}
