:root {
  --teal-deep: #0f3d46;
  --teal-dark: #154f5a;
  --teal-mid: #216978;
  --teal-light: #e0f2f4;
  --teal-ink: #032b35;
  --text: #1a2b30;
  --muted: #5a7076;
  --white: #ffffff;
  --danger: #c0392b;
  --success: #1e7a5a;
  --glass: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(224, 242, 244, 0.35);
  --font-body: "Open Sans", system-ui, sans-serif;
  --font-display: "Sora", "Open Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--teal-deep);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

/* ——— Hero / auth shell ——— */

.auth-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.auth-backdrop video,
.auth-backdrop .backdrop-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenBurns 28s ease-in-out infinite alternate;
}

.auth-backdrop .backdrop-still {
  z-index: 0;
}

.auth-backdrop video {
  z-index: 1;
}

.auth-backdrop-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(120deg, rgba(15, 61, 70, 0.88) 0%, rgba(21, 79, 90, 0.72) 45%, rgba(3, 43, 53, 0.55) 100%),
    radial-gradient(ellipse at 70% 30%, rgba(33, 105, 120, 0.35), transparent 55%);
  pointer-events: none;
}

.auth-backdrop-texture {
  position: absolute;
  inset: 0;
  z-index: 3;
  background-image: url("../assets/images/panel-glow.png");
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  mix-blend-mode: soft-light;
  pointer-events: none;
  animation: drift 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-2%, 1%, 0) scale(1.05);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-main {
  position: relative;
  z-index: 4;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 3rem;
  animation: fadeUp 0.7s ease-out both;
}

.auth-layout {
  width: min(1080px, 100%);
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr minmax(340px, 420px);
    gap: 3.5rem;
  }
}

.brand-block {
  color: var(--white);
  text-align: center;
}

@media (min-width: 900px) {
  .brand-block {
    text-align: left;
  }
}

.brand-name {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--white);
}

.brand-headline {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--teal-light);
}

.brand-support {
  margin: 0;
  max-width: 28rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(224, 242, 244, 0.82);
}

@media (min-width: 900px) {
  .brand-support {
    margin: 0;
  }
}

@media (max-width: 899px) {
  .brand-support {
    margin-inline: auto;
  }
}

/* ——— Auth panel ——— */

.auth-panel {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 18px 48px rgba(3, 43, 53, 0.28);
  animation: fadeUp 0.85s ease-out 0.12s both;
}

@media (min-width: 480px) {
  .auth-panel {
    padding: 2rem 1.75rem 1.75rem;
  }
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  padding: 0.25rem;
  background: rgba(21, 79, 90, 0.08);
  border-radius: 8px;
}

.auth-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.65rem 0.5rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.auth-tab:hover {
  color: var(--teal-dark);
}

.auth-tab.is-active {
  background: var(--white);
  color: var(--teal-dark);
  box-shadow: 0 1px 3px rgba(3, 43, 53, 0.1);
}

.auth-view {
  display: none;
  animation: panelIn 0.35s ease-out both;
}

.auth-view.is-active {
  display: block;
}

.auth-view h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--teal-ink);
}

.auth-view > p {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

.form-row {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 480px) {
  .form-row.two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--teal-mid);
}

.field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(33, 105, 120, 0.28);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  border-color: var(--teal-mid);
  box-shadow: 0 0 0 3px rgba(33, 105, 120, 0.15);
}

.field input.is-invalid {
  border-color: var(--danger);
}

.form-error {
  min-height: 1rem;
  font-size: 0.75rem;
  color: var(--danger);
}

.form-global-error {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--danger);
  display: none;
}

.form-global-error.is-visible {
  display: block;
}

.btn-primary {
  width: 100%;
  margin-top: 1.15rem;
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-mid));
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.legal-note {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.legal-note button {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  color: var(--teal-mid);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.success-panel {
  text-align: center;
  padding: 1rem 0.25rem;
  animation: fadeUp 0.45s ease-out both;
}

.success-panel .success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(30, 122, 90, 0.12);
  color: var(--success);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

.success-panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--teal-ink);
}

.success-panel p {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ——— Footer ——— */

.site-footer {
  position: relative;
  z-index: 4;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal-mid));
  color: var(--white);
  padding: 3rem 1.25rem 2rem;
}

.footer-inner {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.footer-disclaimer {
  display: grid;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(33, 105, 120, 0.5);
}

@media (min-width: 768px) {
  .footer-disclaimer {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

.footer-disclaimer h5 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-disclaimer h5.risk {
  color: #fde047;
}

.footer-disclaimer h5.legal {
  color: #d1d5db;
}

.footer-disclaimer p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #9ca3af;
}

.footer-disclaimer p + p {
  margin-top: 0.5rem;
}

.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(33, 105, 120, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-bottom .copy {
  margin: 0;
  font-size: 0.75rem;
  color: #d1d5db;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem;
}

.footer-links a {
  font-size: 0.75rem;
  color: #d1d5db;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--teal-light);
}

/* ——— Modals ——— */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow: auto;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.modal-open {
  opacity: 1;
}

.modal-content {
  position: relative;
  background: var(--white);
  margin: 5vh auto;
  padding: 2rem 1.5rem 1.75rem;
  width: min(640px, calc(100% - 2rem));
  border-radius: 10px;
  max-height: 85vh;
  overflow-y: auto;
  color: var(--text);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.modal.modal-open .modal-content {
  transform: scale(1);
}

.modal-content .close {
  position: absolute;
  top: 0.65rem;
  right: 0.85rem;
  appearance: none;
  border: none;
  background: none;
  font-size: 1.75rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
}

.modal-content .close:hover {
  color: #4b5563;
}

.modal-content h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--teal-ink);
}

.modal-content h3 {
  margin: 1rem 0 0.35rem;
  font-size: 1rem;
  color: var(--teal-dark);
}

.modal-content p,
.modal-content li {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #374151;
}

.modal-content ul {
  margin: 0.35rem 0;
  padding-left: 1.25rem;
}

.modal-content a {
  color: var(--teal-mid);
}

.modal-content .bg-gray-50 {
  background: #f9fafb;
  padding: 1.1rem;
  border-radius: 8px;
}

.modal-content .text-indigo-700 {
  color: var(--teal-dark);
}

@media (prefers-reduced-motion: reduce) {
  .auth-backdrop video,
  .auth-backdrop .backdrop-still,
  .auth-backdrop-texture,
  .auth-main,
  .auth-panel,
  .auth-view,
  .success-panel {
    animation: none !important;
  }
}
