/* ========================================
   RESET & VARIABLES
   ======================================== */

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

:root {
  /* Colors - Verde Salvia Palette */
  --color-primary: #9FB89A;
  --color-primary-dark: #8EAD88;
  --color-primary-light: #A8C4A3;
  
  --color-bg: #F5F5F3;
  --color-bg-secondary: #FAFAF8;
  --color-card: #FFFFFF;
  
  --color-text-primary: #3D3935;
  --color-text-secondary: #8B8883;
  --color-text-light: #ADA9A4;
  
  --color-icon-bg: #D9E5D6;
  --color-icon-accent: #67998C;
  
  --color-border: #E8E6E3;
  --color-input-bg: #FAFAF8;
  
  --color-success: #5BBE7A;
  --color-error: #E56B6B;
  --color-warning: #F0AD4E;
  
  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  /* Animation */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   BACK BUTTON
   ======================================== */

.back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: var(--color-card);
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  color: var(--color-text-primary);
  transition: all var(--transition);
  z-index: 100;
}

.back-btn:hover {
  background: var(--color-text-primary);
  color: white;
  transform: translateX(-3px);
}

.back-btn:active {
  transform: translateX(-3px) scale(0.95);
}

/* ========================================
   MAIN CONTAINER
   ======================================== */

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px 40px;
  max-width: 480px;
  margin: 0 auto;
}

/* ========================================
   ILLUSTRATION SECTION
   ======================================== */

.illustration-section {
  position: relative;
  width: 100%;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-xl);
}

/* Floating Icons */
.float-icon {
  position: absolute;
  animation: float 6s ease-in-out infinite;
}

.float-icon-1 {
  top: 10%;
  left: 8%;
  animation-delay: 0s;
}

.float-icon-2 {
  top: 15%;
  right: 12%;
  animation-delay: 2s;
}

.float-icon-3 {
  bottom: 8%;
  right: 5%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

/* Character */
.character-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.character-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(159, 184, 154, 0.2) 0%, transparent 70%);
  border-radius: var(--radius-full);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.character-img {
  width: 220px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.1));
  animation: bounce 4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* ========================================
   MESSAGE TOAST
   ======================================== */

.message-toast {
  position: fixed;
  top: 80px;
  left: 20px;
  right: 20px;
  max-width: 440px;
  margin: 0 auto;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
  transition: all var(--transition);
}

.message-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.message-toast.success {
  background: #E8F7ED;
  color: #2D7A4A;
  border: 1px solid #9FE2B8;
}

.message-toast.error {
  background: #FDECEA;
  color: #C13030;
  border: 1px solid #F5A9A0;
}

.message-toast.info {
  background: #E6F4FA;
  color: #1B5E7E;
  border: 1px solid #A0D4EC;
}

/* ========================================
   FORM CONTENT
   ======================================== */

.form-content {
  width: 100%;
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.form-content.active {
  display: block;
}

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

.content-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.title {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 14px;
  color: var(--color-text-light);
  font-weight: 400;
  line-height: 1.5;
}

/* ========================================
   FORM
   ======================================== */

.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  height: 56px;
  transition: all var(--transition);
}

.input-container:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(159, 184, 154, 0.15);
}

.input-icon {
  color: var(--color-text-secondary);
  margin-right: 12px;
  flex-shrink: 0;
  transition: color var(--transition);
}

.input-container:focus-within .input-icon {
  color: var(--color-primary);
}

.input-field {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--color-text-primary);
  font-family: inherit;
  font-weight: 500;
}

.input-field::placeholder {
  color: var(--color-text-light);
  font-weight: 400;
}

.toggle-password {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: color var(--transition);
  margin-left: 8px;
}

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

.eye-icon,
.eye-off-icon {
  display: block;
}

.eye-icon.hidden,
.eye-off-icon.hidden {
  display: none;
}

/* ========================================
   PASSWORD STRENGTH
   ======================================== */

.password-strength {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.password-strength.visible {
  display: flex;
}

.strength-bars {
  display: flex;
  gap: 6px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  transition: background var(--transition);
}

.password-strength.weak .strength-bar:nth-child(1) {
  background: var(--color-error);
}

.password-strength.medium .strength-bar:nth-child(1),
.password-strength.medium .strength-bar:nth-child(2) {
  background: var(--color-warning);
}

.password-strength.strong .strength-bar {
  background: var(--color-success);
}

.strength-label {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.password-strength.weak .strength-label {
  color: var(--color-error);
}

.password-strength.medium .strength-label {
  color: var(--color-warning);
}

.password-strength.strong .strength-label {
  color: var(--color-success);
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */

.submit-btn {
  width: 100%;
  height: 56px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(159, 184, 154, 0.3);
  font-family: inherit;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.submit-btn:active::before {
  width: 300px;
  height: 300px;
}

.submit-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(159, 184, 154, 0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  background: var(--color-text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-text {
  position: relative;
  z-index: 1;
}

/* Loading State */
.submit-btn.loading .btn-text::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   FOOTER TEXT
   ======================================== */

.footer-text {
  text-align: center;
  margin-top: var(--spacing-lg);
  font-size: 14px;
  color: var(--color-text-secondary);
}

.footer-text .link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  margin-left: 6px;
  transition: color var(--transition);
}

.footer-text .link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ========================================
   TABLET & DESKTOP
   ======================================== */

@media (min-width: 768px) {
  .container {
    padding: 60px 40px 40px;
    max-width: 500px;
  }

  .illustration-section {
    height: 350px;
    margin-bottom: var(--spacing-2xl);
  }

  .character-img {
    width: 260px;
  }

  .title {
    font-size: 32px;
  }

  .subtitle {
    font-size: 15px;
  }

  .input-container {
    height: 60px;
  }

  .submit-btn {
    height: 60px;
    font-size: 15px;
  }

  .back-btn {
    top: 30px;
    left: 30px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 520px;
  }

  .back-btn:hover {
    transform: translateX(-5px) scale(1.05);
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
