/* Register — modern academic auth (scoped) */
:root {
  --reg-ink: #0c2340;
  --reg-ink-soft: #243b55;
  --reg-mist: #eef3f8;
  --reg-paper: #ffffff;
  --reg-accent: #c47a72;
  --reg-accent-deep: #a85f58;
  --reg-line: rgba(12, 35, 64, 0.12);
  --reg-danger: #b42318;
  --reg-success: #067647;
  --reg-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

.reg-body {
  font-family: "Poppins", sans-serif;
  color: var(--reg-ink-soft);
  background: var(--reg-mist);
}

.reg-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
}

.reg-brand {
  position: sticky;
  top: 0;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  animation: reg-rise 0.85s var(--reg-ease) both;
}

.reg-brand__media,
.reg-brand__media img,
.reg-brand__veil {
  position: absolute;
  inset: 0;
}

.reg-brand__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: reg-ken 18s ease-in-out infinite alternate;
}

.reg-brand__veil {
  z-index: 1;
  background:
    linear-gradient(145deg, rgba(12, 35, 64, 0.94) 12%, rgba(12, 35, 64, 0.62) 55%, rgba(12, 35, 64, 0.4) 100%),
    linear-gradient(to top, rgba(12, 35, 64, 0.78), transparent 50%);
}

.reg-brand__content {
  position: relative;
  z-index: 2;
  padding: 2.75rem;
  max-width: 32rem;
}

.reg-brand__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  text-decoration: none;
  color: #fff;
}

.reg-brand__logo img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.reg-brand__logo span {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 650;
}

.reg-brand__eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.reg-brand__title {
  margin: 0 0 0.85rem;
  font-family: "Fraunces", serif;
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
}

.reg-brand__lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

.reg-panel {
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem 2.5rem;
  background:
    radial-gradient(circle at top right, rgba(196, 122, 114, 0.12), transparent 40%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
  animation: reg-rise 0.85s var(--reg-ease) 0.08s both;
}

.reg-panel__inner {
  width: 100%;
  max-width: 560px;
}

.reg-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  color: #6b7c8f;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
}

.reg-back:hover { color: var(--reg-ink); }

.reg-header { margin-bottom: 1.35rem; }

.reg-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--reg-accent-deep);
}

.reg-title {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", serif;
  font-size: 1.85rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--reg-ink);
}

.reg-sub {
  margin: 0;
  font-size: 0.92rem;
  color: #6b7c8f;
  line-height: 1.55;
}

.reg-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  border: 1px solid transparent;
}

.reg-alert--error {
  background: #fef3f2;
  color: var(--reg-danger);
  border-color: rgba(180, 35, 24, 0.15);
}

.reg-alert--success {
  background: #ecfdf3;
  color: var(--reg-success);
  border-color: rgba(6, 118, 71, 0.15);
}

.reg-section {
  margin-bottom: 1.35rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--reg-line);
}

.reg-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.reg-section__title {
  margin: 0 0 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--reg-ink);
}

.reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.reg-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.reg-field--full { grid-column: 1 / -1; }

.reg-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--reg-ink);
}

.reg-field input,
.reg-field select {
  width: 100%;
  border: 1px solid var(--reg-line);
  background: var(--reg-paper);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 0.92rem;
  color: var(--reg-ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reg-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a9aab' d='M1.4.3L6 4.9 10.6.3 12 1.7 6 7.7 0 1.7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.reg-field input:focus,
.reg-field select:focus {
  outline: none;
  border-color: rgba(196, 122, 114, 0.55);
  box-shadow: 0 0 0 4px rgba(196, 122, 114, 0.15);
}

.reg-field.is-invalid input,
.reg-field.is-invalid select {
  border-color: rgba(180, 35, 24, 0.45);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.08);
}

.reg-input {
  position: relative;
  display: flex;
  align-items: center;
}

.reg-input input {
  padding-right: 2.75rem;
}

.reg-toggle-pass {
  position: absolute;
  right: 0.4rem;
  border: 0;
  background: transparent;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 8px;
  color: #8a9aab;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reg-toggle-pass:hover {
  color: var(--reg-ink);
  background: var(--reg-mist);
}

.reg-field__error {
  margin: 0;
  font-size: 0.76rem;
  color: var(--reg-danger);
}

.reg-hint {
  margin: 0;
  font-size: 0.74rem;
  color: #8a9aab;
  line-height: 1.4;
}

.reg-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.reg-strength span {
  height: 4px;
  border-radius: 999px;
  background: #d7e0ea;
}

.reg-strength[data-level="1"] span:nth-child(1) { background: #f04438; }
.reg-strength[data-level="2"] span:nth-child(-n+2) { background: #f79009; }
.reg-strength[data-level="3"] span:nth-child(-n+3) { background: #fdb022; }
.reg-strength[data-level="4"] span { background: #12b76a; }

.reg-submit {
  margin-top: 0.35rem;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.25rem;
  background: var(--reg-accent);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(196, 122, 114, 0.28);
  transition: transform 0.25s var(--reg-ease), background 0.2s ease;
}

.reg-submit:hover:not(:disabled) {
  background: var(--reg-accent-deep);
  transform: translateY(-2px);
}

.reg-submit:disabled {
  opacity: 0.75;
  cursor: wait;
  transform: none;
}

.reg-footer-text {
  margin: 1.4rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: #6b7c8f;
}

.reg-footer-text a {
  color: var(--reg-accent-deep);
  font-weight: 600;
  text-decoration: none;
}

.reg-footer-text a:hover { text-decoration: underline; }

@keyframes reg-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reg-ken {
  from { transform: scale(1.06); }
  to { transform: scale(1.12) translate3d(-1%, -0.8%, 0); }
}

@media (max-width: 991.98px) {
  .reg-shell { grid-template-columns: 1fr; }
  .reg-brand {
    position: relative;
    min-height: 220px;
  }
  .reg-brand__content { padding: 1.5rem 1.35rem; }
  .reg-brand__logo { margin-bottom: 1.1rem; }
  .reg-brand__lead { display: none; }
  .reg-panel { padding: 1.35rem 1.15rem 2rem; }
}

@media (max-width: 575.98px) {
  .reg-grid { grid-template-columns: 1fr; }
  .reg-field--full { grid-column: auto; }
}
