@import url("https://fonts.googleapis.com/css?family=Montserrat:400,800");

:root {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-tertiary: #2d2d2d;
  --accent-primary: #00d4ff;
  --accent-secondary: #0ea5e9;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: rgba(80, 80, 80, 0.5);
  --gradient-primary: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Montserrat", sans-serif;
  margin: 0;
  padding: 0;
}

h1 {
  font-weight: bold;
  margin: 0 0 20px 0;
  font-size: 2rem;
  color: var(--text-primary);
}

p {
  font-size: 14px;
  font-weight: 100;
  line-height: 20px;
  letter-spacing: 0.5px;
  margin: 20px 0 30px;
  color: var(--text-secondary);
}

span {
  font-size: 12px;
  color: var(--text-muted);
  margin: 15px 0;
  display: block;
}

a {
  color: var(--accent-primary);
  font-size: 14px;
  text-decoration: none;
  margin: 15px 0;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

button {
  border-radius: 10px;
  border: 1px solid var(--accent-primary);
  background: var(--bg-primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  padding: 15px 50px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  cursor: pointer;
}

button:hover {
  background: var(--gradient-primary);
  border-color: var(--accent-primary);
}

button:focus {
  outline: none;
}

button.ghost {
  background-color: transparent;
  border: 2px solid var(--bg-primary);
  color: #ffffff;
  transition: all 0.2s ease;
}

button.ghost:hover {
  background-color: var(--bg-secondary);
  border-color: var(--accent-secondary);
  color: #ffffff;
}

form {
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 50px;
  height: 100vh;
  text-align: center;
  overflow-y: auto;
}

input {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 15px 20px;
  margin: 8px 0;
  width: 100%;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

input:focus {
  background-color: var(--bg-secondary);
  border-color: var(--accent-primary);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

input::placeholder {
  color: var(--text-muted);
}

.container {
  background-color: var(--bg-secondary);
  border-radius: 0;
  box-shadow: none;
  /* Usar position: relative para não sobrescrever headers/footers do site
     e manter o comportamento interno (filhos com position:absolute ficam
     posicionados relativamente a este container). */
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

.row {
  position: relative;
  width: 100%;
  height: 100%;
}

.form-container {
  position: absolute;
  top: 0;
  height: 100vh;
  transition: all 0.6s ease-in-out;
  overflow: hidden;
}

.sign-in-container {
  left: 0;
  width: 50%;
  z-index: 2;
}

.container.right-panel-active .sign-in-container {
  transform: translateX(100%);
}

.sign-up-container {
  left: 0;
  width: 50%;
  opacity: 0;
  z-index: 1;
}

.container.right-panel-active .sign-up-container {
  transform: translateX(100%);
  opacity: 1;
  z-index: 5;
}

.overlay-container {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100vh;
  overflow: hidden;
  transition: transform 0.6s ease-in-out;
  z-index: 100;
}

.container.right-panel-active .overlay-container {
  transform: translateX(-100%);
}

.overlay {
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-secondary) 50%,
    #0ea5e9 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  color: #ffffff;
  position: relative;
  left: -100%;
  height: 100vh;
  width: 200%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
  box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
  overflow: hidden;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.container.right-panel-active .overlay {
  transform: translateX(50%);
}

.overlay-panel {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 40px;
  text-align: center;
  top: 0;
  height: 100vh;
  width: 50%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}

.overlay-left {
  transform: translateX(-20%);
}

.container.right-panel-active .overlay-left {
  transform: translateX(0);
}

.overlay-right {
  right: 0;
  transform: translateX(0);
}

.container.right-panel-active .overlay-right {
  transform: translateX(20%);
}

.ghost_mobile {
  display: none;
}

#mobile_para {
  display: none;
}

/* Phone container */
.phone-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  margin: 8px 0;
}

.country-select {
  position: relative;
  min-width: 100px;
  height: 47px;
  border: 1px solid var(--border-color);
  border-radius: 10px 0 0 10px;
  background: var(--bg-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  transition: all 0.3s ease;
  z-index: 10;
}

.country-select:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

.dropdown-arrow {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  margin-left: 5px;
}

.country-select.open .dropdown-arrow {
  transform: rotate(180deg);
}

.flag {
  width: 20px;
  height: 15px;
  margin-right: 8px;
  border-radius: 2px;
  object-fit: cover;
}

.country-code {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.country-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 10px 10px;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  min-width: 250px;
  max-width: 280px;
  max-height: 220px;
}

.country-dropdown.show {
  display: block;
}

.search-container {
  position: relative;
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
}

.country-search {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.country-search:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.country-search::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.countries-list {
  max-height: 150px;
  overflow-y: auto;
  padding: 5px 0;
}

.country-option {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  gap: 10px;
}

.country-option:hover {
  background-color: var(--bg-tertiary);
}

.country-option .flag {
  margin-right: 0;
  flex-shrink: 0;
}

.country-name {
  flex: 1;
  color: var(--text-primary);
  font-size: 13px;
}

.country-code-option {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

#phone-input {
  flex: 1;
  border-radius: 0 10px 10px 0;
  border-left: none;
  padding-left: 15px;
  margin: 0;
}

.countries-list::-webkit-scrollbar {
  width: 6px;
}

.countries-list::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

.countries-list::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 3px;
  transition: background 0.3s ease;
}

.countries-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* Validation styles */
.input-container {
  position: relative;
  width: 100%;
  margin: 8px 0;
}

.email-validation,
.password-validation,
.confirm-password-validation {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: bold;
  z-index: 10;
}

.valid {
  color: #10b981;
}

.invalid {
  color: #ef4444;
}

/* Password toggle icon */
.password-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  margin: 8px 0;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 40px;
  margin: 0;
}

.toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s ease;
  z-index: 10;
  font-size: 18px;
}

.toggle-password:hover {
  color: var(--accent-primary);
}

.toggle-password.fa-eye-slash {
  color: var(--accent-primary);
}

/* Terms checkbox */
.terms-container {
  margin: 10px 0;
  width: 100%;
  transition: all 0.3s ease;
}

.terms-error {
  animation: shake 0.5s;
  border-radius: 5px;
  background-color: rgba(255, 0, 0, 0.1);
  padding: 5px;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-secondary);
  gap: 8px;
  text-align: left;
}

.checkbox-container input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
}

.checkmark {
  position: relative;
  height: 16px;
  width: 16px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-container:hover .checkmark {
  background-color: var(--bg-secondary);
  border-color: var(--accent-primary);
}

.checkbox-container .checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--bg-secondary);
  border-color: var(--accent-primary);
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-text {
  flex: 1;
  margin: 0;
  display: inline;
}

.terms-link {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.3s ease;
  margin: 0;
}

.terms-link:hover {
  color: var(--accent-secondary);
}

/* RESPONSIVE DESIGN */

/* Tablets */
@media only screen and (max-width: 1024px) {
  .overlay-panel {
    padding: 0 30px;
  }

  h1 {
    font-size: 1.8rem;
  }

  form {
    padding: 0 40px;
  }
}

/* Mobile devices */
@media only screen and (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
  }

  .container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  .overlay-container {
    display: none !important;
  }

  .form-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100vh;
    z-index: 2;
  }

  .sign-up-container {
    opacity: 0;
    z-index: 1;
    transform: translateX(100%);
  }

  .sign-in-container {
    opacity: 1;
    z-index: 2;
    transform: translateX(0);
  }

  .container.right-panel-active .sign-up-container {
    opacity: 1;
    z-index: 5;
    transform: translateX(0);
  }

  .container.right-panel-active .sign-in-container {
    opacity: 0;
    z-index: 1;
    transform: translateX(-100%);
  }

  .ghost_mobile {
    display: block !important;
    font-size: 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--accent-primary);
    margin-top: 20px;
    padding: 12px 30px;
    border-radius: 10px;
    color: var(--text-primary);
  }

  .ghost_mobile:hover {
    background: var(--gradient-primary);
  }

  #mobile_para {
    display: block !important;
    margin: 15px 0 10px 0;
    font-size: 13px;
    color: var(--text-secondary);
  }

  form {
    padding: 20px 25px;
    justify-content: flex-start;
    padding-top: 60px;
  }

  h1 {
    font-size: 1.6rem;
    margin-bottom: 15px;
  }

  input {
    padding: 14px 18px;
    margin: 8px 0;
    font-size: 15px;
  }

  button {
    padding: 14px 35px;
    margin: 15px 0;
    font-size: 13px;
  }

  /* Phone container mobile */
  .phone-container {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
  }

  .country-select {
    border-radius: 10px 0 0 10px;
    width: auto;
    min-width: 90px;
    max-width: 100px;
    justify-content: space-between;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-right: none;
  }

  .country-dropdown {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: auto;
    min-width: auto;
    max-width: none;
    max-height: 50vh;
    border-radius: 10px;
    z-index: 9999;
  }

  .countries-list {
    max-height: 200px;
  }

  .search-container {
    padding: 12px;
  }

  .country-search {
    padding: 12px 40px 12px 15px;
    font-size: 15px;
  }

  .country-option {
    padding: 12px 15px;
    font-size: 14px;
  }

  #phone-input {
    border-radius: 0 10px 10px 0;
    border: 1px solid var(--border-color);
    border-left: none;
    width: 100%;
    margin: 0;
    flex: 1;
  }

  .checkbox-container {
    font-size: 12px;
    gap: 8px;
    line-height: 1.4;
  }

  .checkmark {
    height: 16px;
    width: 16px;
    margin-top: 1px;
  }
}

/* Small smartphones */
@media only screen and (max-width: 480px) {
  form {
    padding: 15px 20px;
    padding-top: 50px;
  }

  h1 {
    font-size: 1.4rem;
    margin-bottom: 12px;
  }

  input {
    padding: 12px 15px;
    font-size: 14px;
    margin: 6px 0;
  }

  button {
    padding: 12px 25px;
    font-size: 12px;
    margin: 12px 0;
  }

  .ghost_mobile {
    padding: 10px 25px;
    font-size: 0.8rem;
  }

  p,
  #mobile_para {
    font-size: 12px;
    margin: 12px 0;
  }

  span {
    font-size: 11px;
    margin: 10px 0;
  }

  .checkbox-container {
    font-size: 11px;
    gap: 6px;
    line-height: 1.3;
  }

  .checkmark {
    height: 14px;
    width: 14px;
  }

  .checkbox-container .checkmark:after {
    left: 4px;
    top: 1px;
    width: 3px;
    height: 7px;
  }
}

/* Very small devices */
@media only screen and (max-width: 360px) {
  form {
    padding: 10px 15px;
    padding-top: 40px;
  }

  h1 {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }

  input {
    padding: 10px 12px;
    font-size: 13px;
  }

  button {
    padding: 10px 20px;
    font-size: 11px;
  }

  .ghost_mobile {
    padding: 8px 20px;
    font-size: 0.75rem;
  }

  .checkbox-container {
    font-size: 10px;
    gap: 5px;
  }

  .checkmark {
    height: 12px;
    width: 12px;
  }

  .checkbox-container .checkmark:after {
    left: 3px;
    top: 0px;
    width: 3px;
    height: 6px;
  }
}

/* Landscape mobile */
@media only screen and (max-height: 500px) and (orientation: landscape) {
  form {
    padding: 10px 25px;
    padding-top: 20px;
    height: 100vh;
    overflow-y: auto;
  }

  h1 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  input {
    margin: 4px 0;
    padding: 10px 15px;
  }

  button {
    margin: 8px 0;
    padding: 10px 25px;
  }

  .ghost_mobile {
    margin-top: 10px;
    padding: 8px 20px;
  }

  #mobile_para {
    margin: 8px 0 5px 0;
  }

  .terms-container {
    margin: 6px 0;
  }

  .checkbox-container {
    font-size: 9px;
  }
}
