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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.background-wrapper {
    min-height: 130vh;
    width: 100%;
    background: linear-gradient(180deg, #4B0082 0%, #1E1E4B 100%);
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    color: #fff;
    background-color: transparent;
}


.logo {
    display: block;
    margin: 0 auto 20px;
    max-width: 150px;
    animation: fadeSlideIn 0.6s ease-out forwards 0.35s;
}

/* TITULOS */
.welcome-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(-15px);
    animation: fadeSlideIn 0.6s ease-out forwards 0.35s;
}

.forms-wrapper {
    position: relative;
    width: 100%;
    min-height: 320px;
}

#login-form, #register-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

#login-form.active, #register-form.active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #555;
    background-color: #333;
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeSlideIn 0.5s ease-out forwards 0.75s;
}

button {
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeSlideIn 0.5s ease-out forwards 0.85s;
}

.login-btn { background-color: #6A5ACD; }
.register-btn { background-color: #7B68EE; }

button:hover {
    opacity: 1;
}

.switch-link {
    margin-top: 18px;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeSlideIn 0.5s ease-out forwards 0.95s;
}

.switch-link a {
    color: #87CEEB;
    text-decoration: none;
    font-weight: 600;
}

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

.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    width: 100%;
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: fit-content;
    z-index: 10;
    color: #ccc;
}

.toggle-password:hover {
    color: #fff;
}

.terms-checkbox {
    display: grid;
    grid-template-columns: 18px 1fr;
    column-gap: 10px;
    align-items: start;
    font-size: 0.85rem;
    line-height: 1.45;
    margin-top: 8px;
    text-align: left;
}

.terms-checkbox input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #7B68EE;
}

.terms-checkbox label {
    cursor: pointer;
}

.terms-checkbox a {
    color: #87CEEB;
    font-weight: 600;
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

.recaptcha-wrapper {
    display: flex;
    justify-content: center;
    margin: 0px 0;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeSlideIn 0.5s ease-out forwards 1.05s;
}

#totp-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 11000;
}

#totp-modal-content {
  background: rgba(30, 30, 47, 0.95);
  color: #fff;
  padding: 30px 24px;
  border-radius: 12px;
  text-align: center;
  min-width: 300px;
  max-width: 90%;
  box-shadow: 0 0 25px rgba(75, 0, 130, 0.6);
  border: 1px solid #4B0082;
  animation: slideUpModal 0.35s ease forwards;
}

#totp-modal-content input {
  padding: 12px;
  font-size: 1rem;
  width: 100%;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid #555;
  background-color: #333;
  color: #fff;
  text-align: center;
  letter-spacing: 0.35em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  transition: border 0.2s, box-shadow 0.2s;
}

#totp-modal-content input:focus {
  outline: none;
  border-color: #6A5ACD;
  box-shadow: 0 0 8px #6A5ACD;
}

#totp-modal-content button {
  padding: 12px 24px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #6A5ACD;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s;
}

#totp-modal-content button:hover {
  background: #7B68EE;
  box-shadow: 0 0 12px rgba(123,104,238,0.6);
}

#totp-modal-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 14px;
}

#totp-modal-content input {
    padding: 12px;
    font-size: 1rem;
    width: 100%;
    margin: 12px 0;
    border-radius: 8px;
    border: 1px solid #555;
    background-color: #333;
    color: #fff;
    text-align: center;
    letter-spacing: 0.35em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    transition: border 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

#totp-modal-content input:focus {
    outline: none;
    border-color: #6A5ACD;
    box-shadow: 0 0 8px #6A5ACD;
}

#totp-modal-content button {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    background: #6A5ACD;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, box-shadow 0.2s;
}

#totp-modal-content button:hover {
    background: #7B68EE;
    box-shadow: 0 0 12px rgba(123,104,238,0.6);
}

@keyframes fadeSlideIn {
    0% { opacity: 0; transform: translateY(20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes slideUp {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUpModal {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

#pwa-install-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(30,30,75,0.95);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  width: calc(100% - 32px);
  max-width: 420px;
  z-index: 10000; /* menor que modal */
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  font-weight: 600;
  font-size: 0.95rem;
  animation: slideUp 0.4s ease-out;
}

#pwa-install-banner button {
  background-color: #7B68EE;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#pwa-install-banner button:hover {
  background-color: #6A5ACD;
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.password-container .toggle-password {
    opacity: 0;
    animation: fadeSlideIn 0.6s ease-out forwards 0.95s;
}