@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap');

:root {
  --card-max: 520px;
  --card-xl: 640px;
  --radius: 12px;
  --brand: #153d82;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Montserrat', sans-serif;
  color: #333;
  min-height: 100dvh;
  background: url('Img/ubg.jpg') no-repeat center/cover fixed;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px 16px 40px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* ---------- Fade-in Fade-out Scroll Animation ---------- */
.fade-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Logo --- */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 50px;
  margin-bottom: 20px;
  color: white;
}

.logo img {
  width: 55px;
  height: auto;
}

.logo .text a {
  font-size: 26px;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: block;
}

.logo .text p {
  font-size: 13px;
  color: #ccc;
}

/* ---------- Card ---------- */
.container {
  width: min(100%, var(--card-max));
  margin-inline: auto;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ► SCROLLABLE FORM on small screens */
.form-section {
  background: #f7f7f7;
  padding: 34px 18px;
  max-height: calc(120dvh - 200px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.form-wrapper {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.form-wrapper h2 {
  margin-bottom: 6px;
  color: #153d82;
}

.login-link {
  font-size: 14px;
  color: #666;
  margin-bottom: 18px;
}

.login-link a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

/* Inputs */
.input-group {
  width: 100%;
  margin-bottom: 14px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.input-group input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
}

/* Inline errors */
.error {
  display: block;
  color: #c62828;
  font-size: 12px;
  margin-top: 6px;
  min-height: 14px;
}

input.invalid {
  border-color: #c62828;
  box-shadow: 0 0 0 2px rgba(198, 40, 40, .18);
}

/* 1->2 column fields */
.input-group-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.input-group {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #1e1e1e;
  font-weight: bold;
  font-size: 12px;
}

/* Helper text */
.password-hint {
  font-size: 12px;
  color: #888;
  margin: 2px 0 14px;
  line-height: 1.45;
}

/* .show-password-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.show-password-container label {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  cursor: pointer;
} */

/* Buttons */
.action-buttons {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
}

.login-instead {
  font-size: 14px;
  color: #007bff;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
}

.login-instead:hover {
  text-decoration: underline;
}

.create-account-btn {
  position: relative;
  width: 100%;
  background: #fff;
  color: #000;
  border: none;
  border-bottom: 3px solid var(--brand);
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: color .3s;
}

.create-account-btn span {
  position: relative;
  z-index: 2;
}

.create-account-btn::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -100%;
  width: 100%;
  height: 100%;
  background: var(--brand);
  transition: bottom .35s ease;
  z-index: 1;
}

.create-account-btn:hover::before {
  bottom: 0;
}

.create-account-btn:hover span {
  color: #fff;
}

.container .form-section::-webkit-scrollbar {
  display: none;
}

/* -------------------- Breakpoints -------------------- */

@media (min-width:600px) {
  .input-group-row {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .action-buttons {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .create-account-btn {
    width: auto;
  }

  .form-section {
    padding: 28px 24px;
    max-height: calc(110dvh - 200px);
  }
}

@media (min-width:768px) {
  .form-section {
    padding: 34px 32px;
  }

  .container {
    width: min(86%, var(--card-max));
  }
}

@media (min-width:992px) {
  .container {
    width: min(80%, var(--card-xl));
  }

  .form-section {
    padding: 40px;
    max-height: calc(100dvh - 200px);
    overflow: auto;
  }
}

@media (min-width:1280px) {
  .container {
    width: min(48%, var(--card-xl));
  }
}

@media (prefers-reduced-motion: reduce) {
  .create-account-btn::before {
    transition: none;
  }

  .input-group input:focus {
    box-shadow: none;
  }
}