@-webkit-keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.link {
  color: var(--text-color);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.auth-container {
  display: -webkit-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  gap: 3rem;
  /* Fallback for browsers that don't support gap */
  margin: -1.5rem;
  width: 100%;
  max-width: 71.428rem; /* 1000px / 14px base */
  padding: 2rem 0;
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  -webkit-flex-grow: 1;
  flex-grow: 1;
}

.auth-container > * {
  /* Fallback for browsers that don't support gap */
  margin: 1.5rem;
}

.logo-section {
  flex-direction: column;

  display: -webkit-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;

  -webkit-box-flex: 1;
  -ms-flex: 1;
  -webkit-flex: 1;
  flex: 1;

  -webkit-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;

  -webkit-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;

  align-items: center;
  padding-right: 2rem;
}

.logo-font {
  fill: var(--logo-color);
}

.form-section, .content-section {
  flex: 0 0 28.571rem; /* 400px / 14px base */
}

.form, .content-section {
  padding: 1.7rem;
  background-color: var(--form-background-color);
  -webkit-transition: background-color 0.3s ease, box-shadow 0.3s ease;
  -moz-transition: background-color 0.3s ease, box-shadow 0.3s ease;
  -o-transition: background-color 0.3s ease, box-shadow 0.3s ease;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  border-radius: 0.4rem;
  -webkit-box-shadow: var(--container-shadow);
  -moz-box-shadow: var(--container-shadow);
  box-shadow: var(--container-shadow);
  -webkit-animation: fadeIn 0.5s ease-out;
  animation: fadeIn 0.5s ease-out;
}

.oauth-providers {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  padding: 1rem 1.7rem;
  gap: 1rem;
}

.oauth-button {
  display: block;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}

.oauth-button img {
  width: 32px;
  height: 32px;
}

.content-section {
  padding: 2.5rem;
  text-align: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
}

.form-header {
  font-weight: 600;
  color: var(--text-color);
  text-align: center;
  margin: 0;
  line-height: 1.3;
}

.form-header.simple-header {
  font-size: 1.4rem;
  margin-bottom: 1.8rem;
}

.form-title-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-title-area .form-header {
  font-size: 1.25rem;
  flex-grow: 1;
}

/* Back button styles */
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color-secondary);
  border-radius: 50%;
  transition: background-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.back-button svg {
  width: 1.428rem; /* 20px / 14px base */
  height: 1.428rem; /* 20px / 14px base */
  fill: currentColor;
}

.back-button:hover {
  color: var(--text-color);
  background-color: rgba(128, 128, 128, 0.1);
}

/* --- Text and Information Styles --- */
.form-instructions, .error-message-detail {
  font-size: 0.95rem;
  color: var(--text-color-secondary);
  text-align: center;
  margin-bottom: 1.8rem;
  line-height: 1.4;
}

.email-display-info {
  text-align: center;
  color: var(--text-color-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.8rem;
}

.email-display-info strong {
  color: var(--text-color);
  font-weight: 500;
}

.email-display-info a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 5px;
}

.email-display-info a:hover {
  text-decoration: underline;
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.3;
  transition: color 0.3s ease;
}

.error-message {
  display: block;
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 0.3rem;
  line-height: 1.2;
}

.otp-inputs-container + .error-message,
.user-code-inputs-container + .error-message {
  text-align: center;
  margin-top: 0.5rem;
}

.text-input,
.otp-digit-input,
.user-code-character-input,
#user-code-fallback,
#otp-input {
  outline: none;
  border: 1px solid var(--input-border-color);
  background-color: var(--input-background-color);
  color: var(--text-color);
  -webkit-transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  -moz-transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  -o-transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  border-radius: 0.428rem; /* 6px / 14px base */
}

.text-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
}

.text-input::placeholder {
  color: var(--input-placeholder-color);
  opacity: 1;
}

.text-input:focus,
.otp-digit-input:focus,
.user-code-character-input:focus,
#user-code-fallback:focus,
#otp-input:focus {
  outline: none;
  border-color: var(--primary-color);
  -webkit-box-shadow: 0 0 0 0.142rem var(--primary-focus-color); /* 2px / 14px base */
  -moz-box-shadow: 0 0 0 0.142rem var(--primary-focus-color); /* 2px / 14px base */
  box-shadow: 0 0 0 0.142rem var(--primary-focus-color); /* 2px / 14px base */
}

.input-error,
.text-input:invalid,
.text-input:-moz-ui-invalid,
.text-input:user-invalid,
.otp-digit-input.input-error,
.user-code-character-input.input-error {
  border-color: var(--error-color) !important;
  -webkit-box-shadow: 0 0 0 0.142rem var(--error-focus-color) !important; /* 2px / 14px base */
  -moz-box-shadow: 0 0 0 0.142rem var(--error-focus-color) !important; /* 2px / 14px base */
  box-shadow: 0 0 0 0.142rem var(--error-focus-color) !important; /* 2px / 14px base */
}

#otp-input {
  text-align: center;
  letter-spacing: 0.5em;
  font-size: 1.2rem;
}

#otp-container {
  display: none;
}

/* User code fallback */
#user-code-fallback {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

#user-code-fallback::placeholder {
  color: var(--input-placeholder-color);
  opacity: 1;
  letter-spacing: normal;
  text-transform: none;
}

.otp-inputs-container,
.user-code-inputs-container {
  display: none;
  align-items: center;
  justify-content: center;
}

.otp-inputs-container {
  gap: 0.714rem; /* 10px / 14px base */
  display: flex;
}

.user-code-inputs-container {
  gap: 0.357rem; /* 5px / 14px base */
  flex-wrap: nowrap;
}

.otp-digit-input {
  width: 3.214rem; /* 45px / 14px base */
  height: 3.928rem; /* 55px / 14px base */
  font-size: 1.5rem;
  text-align: center;
  caret-color: var(--primary-color);
  line-height: 3.928rem; /* 55px / 14px base */
}

.user-code-character-input {
  width: 2.285rem; /* 32px / 14px base */
  height: 3.214rem; /* 45px / 14px base */
  font-size: 1.2rem;
  text-align: center;
  border-radius: 0.285rem; /* 4px / 14px base */
  caret-color: var(--primary-color);
  line-height: 3.214rem; /* 45px / 14px base */
  text-transform: uppercase;
}

.user-code-dash {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-color-secondary);
  padding: 0 0.142rem; /* 2px / 14px base */
  line-height: 3.214rem; /* 45px / 14px base */
}

.button {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 0.428rem;
  text-align: center;
  -webkit-transition: all 0.15s ease-in-out;
  -moz-transition: all 0.15s ease-in-out;
  -o-transition: all 0.15s ease-in-out;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.button.primary-button {
  color: var(--button-enabled-color);
  border: 1px solid var(--button-enabled-background);
  background-color: var(--button-enabled-background);
}

.button.secondary-button {
  border: 1px solid var(--button-enabled-background);
  color: var(--button-enabled-background);
}

.button:hover {
  opacity: 0.9;
}

.button.primary-button:disabled {
  color: var(--button-disabled-color);
  background-color: var(--button-disabled-background);
  cursor: not-allowed;
  opacity: 0.7;
}

.resend-link-container {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.resend-link {
  color: var(--primary-color);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

.resend-link:hover {
  text-decoration: underline;
}

/* Password label container with forgot password link */
.password-label-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-password-link {
  font-size: 0.9em;
  text-decoration: none;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.page-footer {
  width: 100%;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-color-secondary);
  margin-top: 1rem;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.language-selector {
  position: relative;
  display: inline-block;
}

.language-button {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: 1px solid var(--input-border-color);
  border-radius: 0.285rem; /* 4px / 14px base */
  padding: 0.35rem 0.5rem;
  color: var(--text-color-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.language-button:hover {
  border-color: var(--primary-color);
  color: var(--text-color);
  background-color: var(--input-background-color);
}

.language-icon {
  width: 0.857rem; /* 12px / 14px base */
  height: 0.857rem; /* 12px / 14px base */
  fill: currentColor;
}

.current-language {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 500;
  min-width: 1.4rem;
}

.dropdown-arrow {
  width: 0.571rem; /* 8px / 14px base */
  height: 0.571rem; /* 8px / 14px base */
  fill: currentColor;
  transition: transform 0.2s ease;
}

.language-selector:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--form-background-color);
  border: 1px solid var(--input-border-color);
  border-radius: 0.428rem; /* 6px / 14px base */
  box-shadow: var(--container-shadow);
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  min-width: 8rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(0.5rem);
  transition: all 0.2s ease;
  z-index: 1000;
}

.language-selector:hover .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.language-option {
  display: block;
  padding: 0.5rem 0.857rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.8rem;
  transition: background-color 0.15s ease;
  border: none;
  text-align: left;
  width: 100%;
}

.language-option:hover {
  background-color: var(--input-background-color);
  color: var(--text-color);
}

.language-option.active {
  background-color: var(--primary-color);
  color: var(--button-enabled-color);
  font-weight: 500;
}

.language-option.active:hover {
  background-color: var(--primary-color);
  opacity: 0.9;
}

.heading {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.8rem;
}

.actions {
  width: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 0.8rem;
  /* Fallback for browsers that don't support gap */
  margin-top: 0.4rem;
  -webkit-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
}

.actions > * {
  /* Fallback for browsers that don't support gap */
  margin-top: 0.8rem;
}


/* Checkbox styles */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-input {
  width: 1.142rem; /* 16px / 14px base */
  height: 1.142rem; /* 16px / 14px base */
  border: 1px solid var(--input-border-color);
  border-radius: 0.214rem; /* 3px / 14px base */
  background-color: var(--input-background-color);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 0.071rem; /* 1px / 14px base - align with text baseline */
  transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
}

.checkbox-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-input:checked::after {
  content: '';
  position: absolute;
  left: 0.285rem; /* 4px / 14px base */
  top: 0.071rem; /* 1px / 14px base */
  width: 0.357rem; /* 5px / 14px base */
  height: 0.571rem; /* 8px / 14px base */
  border: solid var(--button-enabled-color);
  border-width: 0 0.142rem 0.142rem 0; /* 0 2px 2px 0 / 14px base */
  transform: rotate(45deg);
}

.checkbox-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.142rem var(--primary-focus-color); /* 2px / 14px base */
}

.checkbox-input.input-error {
  border-color: var(--error-color) !important;
  box-shadow: 0 0 0 0.142rem var(--error-focus-color) !important; /* 2px / 14px base */
}

.checkbox-text {
  vertical-align: top;
}

.privacy-policy-description {
  font-size: 0.857rem; /* 12px / 14px base */
  color: var(--text-color-secondary);
  line-height: 1.4;
  margin-top: 0.357rem; /* 5px / 14px base */
  margin-bottom: 0;
}

.privacy-policy-description a {
  color: var(--primary-color);
  text-decoration: none;
}

.privacy-policy-description a:hover {
  text-decoration: underline;
}

/* Registration */

.strength-container {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0 1rem;
}

.strength-meter {
  height: 5px;
  background-color: #e0e0e0;
  border-radius: 15px;
  margin-bottom: 5px;
}

.strength-bar {
  height: 100%;
  width: 0;
  border-radius: 15px;
  transition: width 0.3s, background-color 0.3s;
}

.strength-bar.weak {
  width: 25%;
  background-color: #ff4d4d;
}
.strength-bar.fair {
  width: 50%;
  background-color: #ffa64d;
}
.strength-bar.good {
  width: 75%;
  background-color: #99cc00;
}
.strength-bar.excellent {
  width: 100%;
  background-color: #00cc66;
}

/* Media size */

@media (max-width: 768px) {
  body {
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
  }

  .auth-container {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 0;
    -webkit-box-flex: 0;
    -ms-flex-positive: 0;
    -webkit-flex-grow: 0;
    flex-grow: 0;
  }
  
  .auth-container > * {
    /* Update fallback margin for smaller screens */
    margin: 1rem;
  }

  .logo-section {
    padding-right: 0;
    margin-bottom: 0;
    flex: none;
    width: 100%;
    justify-content: center;
  }

  .logo {
    height: 6rem;
  }

  .form-section, .content-section {
    flex-basis: auto;
    width: 100%;
    max-width: 28.571rem; /* 400px / 14px base */
  }
  .content-section {
    padding: 2rem;
  }

  .form-header.simple-header {
    font-size: 1.3rem;
  }

  .form-title-area .form-header {
    font-size: 1.2rem;
  }

  .form-instructions, .message-detail {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .otp-digit-input {
    width: 2.857rem; /* 40px / 14px base */
    height: 3.571rem; /* 50px / 14px base */
    font-size: 1.3rem;
    line-height: 3.571rem; /* 50px / 14px base */
  }

  .otp-inputs-container {
    gap: 0.571rem; /* 8px / 14px base */
  }

  .user-code-character-input {
    width: 2.142rem; /* 30px / 14px base */
    height: 3rem; /* 42px / 14px base */
    line-height: 3rem; /* 42px / 14px base */
    font-size: 1.1rem;
  }

  .user-code-dash {
    line-height: 3rem; /* 42px / 14px base */
    font-size: 1.1rem;
  }

  .user-code-inputs-container {
    gap: 0.285rem; /* 4px / 14px base */
  }

  .page-footer {
    margin-top: 2rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .language-dropdown {
    min-width: 7rem;
  }

  .heading {
    font-size: 1.3rem;
  }

  .checkbox-input {
    width: 1.071rem; /* 15px / 14px base */
    height: 1.071rem; /* 15px / 14px base */
  }

  .checkbox-input:checked::after {
    left: 0.25rem; /* 3.5px / 14px base */
    top: 0.05rem; /* 0.7px / 14px base */
    width: 0.321rem; /* 4.5px / 14px base */
    height: 0.5rem; /* 7px / 14px base */
  }

  .privacy-policy-description {
    font-size: 0.821rem; /* 11.5px / 14px base */
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .form-section, .content-section {
    padding: 1.5rem;
  }

  .form-header.simple-header {
    font-size: 1.2rem;
  }

  .form-title-area {
    gap: 0.3rem;
    margin-bottom: 1rem;
  }

  .form-title-area .form-header {
    font-size: 1.1rem;
  }

  .back-button svg {
    width: 1.2rem; /* 18px / 15px base */
    height: 1.2rem; /* 18px / 15px base */
  }

  .email-display-info {
    margin-bottom: 1.5rem;
  }

  .form-instructions, .message-detail {
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
  }

  #otp-fallback {
    font-size: 1rem;
    letter-spacing: 0.3em;
  }

  #user-code-fallback {
    font-size: 1rem;
    letter-spacing: 0.1em;
  }

  .otp-digit-input {
    width: 2.333rem; /* 35px / 15px base */
    height: 3rem; /* 45px / 15px base */
    font-size: 1.2rem;
    line-height: 3rem; /* 45px / 15px base */
  }

  .otp-inputs-container {
    gap: 0.333rem; /* 5px / 15px base */
  }

  .user-code-character-input {
    width: 1.733rem; /* 26px / 15px base */
    height: 2.533rem; /* 38px / 15px base */
    line-height: 2.533rem; /* 38px / 15px base */
    font-size: 1rem;
  }

  .user-code-dash {
    line-height: 2.533rem; /* 38px / 15px base */
    font-size: 1rem;
  }

  .user-code-inputs-container {
    gap: 0.2rem; /* 3px / 15px base */
  }

  .button {
    padding: 0.7rem 1rem;
  }

  .resend-link-container {
    margin-top: 1rem;
  }

  .heading {
    font-size: 1.2rem;
  }

  .language-button {
    padding: 0.3rem 0.4rem;
    font-size: 0.75rem;
  }

  .language-icon {
    width: 0.733rem; /* 11px / 15px base */
    height: 0.733rem; /* 11px / 15px base */
  }

  .dropdown-arrow {
    width: 0.466rem; /* 7px / 15px base */
    height: 0.466rem; /* 7px / 15px base */
  }

  .language-dropdown {
    min-width: 6.5rem;
  }

  .language-option {
    padding: 0.4rem 0.733rem;
    font-size: 0.75rem;
  }

  .checkbox-input {
    width: 0.933rem; /* 14px / 15px base */
    height: 0.933rem; /* 14px / 15px base */
  }

  .checkbox-input:checked::after {
    left: 0.2rem; /* 3px / 15px base */
    top: 0.033rem; /* 0.5px / 15px base */
    width: 0.266rem; /* 4px / 15px base */
    height: 0.433rem; /* 6.5px / 15px base */
  }

  .privacy-policy-description {
    font-size: 0.733rem; /* 11px / 15px base */
  }
}
