/* ================================
   Variables & Reset
================================ */
:root {
  --blue-900: #1e3a8a;
  --blue-800: #1e40af;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --yellow-400: #facc15;
  --yellow-500: #eab308;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-800: #166534;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --orange-100: #ffedd5;
  --orange-500: #f97316;
  --orange-600: #ea580c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  min-height: 100vh;
  background: linear-gradient(
    145deg,
    var(--blue-900) 0%,
    var(--blue-800) 30%,
    var(--blue-600) 70%,
    var(--blue-500) 100%
  );
  color: var(--gray-800);
  line-height: 1.6;
}

/* ================================
   Header
================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--blue-100);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  text-decoration: none;
  transition: all 0.2s;
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.back-link:hover {
  color: var(--blue-600);
  background: var(--blue-50);
}

.back-text {
  display: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-img {
  height: 2rem;
  width: 2rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue-900);
}

.lang-switcher {
  display: flex;
  gap: 0.25rem;
  background: var(--gray-100);
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.lang-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: var(--gray-500);
}

.lang-btn.active {
  background: var(--white);
  color: var(--blue-600);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lang-btn:not(.active):hover {
  color: var(--gray-700);
}

/* ================================
   Main Content
================================ */
.main {
  padding: 5rem 1rem 2rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 26rem;
}

/* ================================
   Hero Section
================================ */
.hero {
  text-align: center;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.5s ease-out;
}

.hero-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--yellow-400);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.hero-icon i {
  font-size: 2rem;
  color: var(--white);
}

.hero-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  color: var(--blue-100);
  font-size: 1rem;
  opacity: 0.9;
}

/* ================================
   Card
================================ */
.card {
  background: var(--white);
  padding: 1.5rem;
  animation: slideUp 0.5s ease-out 0.1s both;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

/* ================================
   Security Banner
================================ */
.security-banner {
  background: linear-gradient(135deg, var(--green-100) 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.security-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.security-icon i {
  color: var(--green-600);
  font-size: 0.875rem;
}

.security-text {
  font-size: 0.875rem;
  color: var(--green-800);
  font-weight: 500;
}

/* ================================
   Form
================================ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  color: var(--gray-700);
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.875rem;
  pointer-events: none;
  transition: color 0.2s;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 1rem;
  transition: all 0.2s;
}

.form-input.with-icon {
  padding-left: 2.75rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--blue-500);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--blue-500);
}

.password-wrapper {
  position: relative;
}

.password-wrapper .input-icon {
  left: 1rem;
}

.password-wrapper .form-input {
  padding-left: 2.75rem;
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}

.password-toggle:hover {
  color: var(--gray-600);
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.checkbox {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--blue-600);
  cursor: pointer;
}

/* ================================
   Primary Button
================================ */
.btn-primary {
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-600) 100%);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ================================
   Recovery Section
================================ */
.recovery-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

.recovery-title {
  font-size: 0.875rem;
  color: var(--gray-500);
  text-align: center;
  margin-bottom: 0.75rem;
}

.recovery-options {
  display: flex;
  gap: 0.75rem;
}

.recovery-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  background: var(--blue-50);
  color: var(--blue-600);
  border: 1px solid var(--blue-100);
}

.recovery-btn:hover {
  background: var(--blue-100);
  border-color: var(--blue-200);
}

.recovery-btn-alt {
  background: var(--orange-100);
  color: var(--orange-600);
  border-color: #fed7aa;
}

.recovery-btn-alt:hover {
  background: #ffedd5;
  border-color: #fdba74;
}

.recovery-btn i {
  font-size: 0.875rem;
}

/* ================================
   Divider
================================ */
.divider {
  position: relative;
  margin: 1.5rem 0;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gray-200);
}

.divider span {
  position: relative;
  background: var(--white);
  padding: 0 1rem;
  color: var(--gray-400);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ================================
   Google Button
================================ */
.google-btn-wrapper {
  display: flex;
  justify-content: center;
}

/* ================================
   Register Link
================================ */
.register-link {
  margin-top: 1.5rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

.register-link p {
  color: var(--gray-600);
  font-size: 0.9375rem;
}

.register-link a {
  color: var(--blue-600);
  font-weight: 600;
  text-decoration: none;
  margin-left: 0.25rem;
  transition: color 0.2s;
}

.register-link a:hover {
  color: var(--blue-800);
  text-decoration: underline;
}

/* ================================
   Trust Badges
================================ */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  animation: fadeIn 0.5s ease-out 0.3s both;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
}

.badge i {
  font-size: 0.875rem;
  color: var(--yellow-400);
}

/* ================================
   Modals
================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--white);
  border-radius: 1.25rem;
  padding: 2rem;
  max-width: 20rem;
  width: calc(100% - 2rem);
  text-align: center;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  animation: scaleIn 0.3s ease-out;
}

.loading-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-modal p {
  color: var(--gray-700);
  font-weight: 500;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.message-icon-wrapper {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-icon-wrapper.success {
  background: var(--green-100);
}

.message-icon-wrapper.success i {
  color: var(--green-500);
}

.message-icon-wrapper.error {
  background: var(--red-100);
}

.message-icon-wrapper.error i {
  color: var(--red-500);
}

.message-modal h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.message-modal p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.message-modal i {
  font-size: 2rem;
}

/* ================================
   Support Button
================================ */
.support-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(135deg, var(--yellow-400) 0%, var(--yellow-500) 100%);
  color: var(--blue-900);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(250, 204, 21, 0.4);
  text-decoration: none;
  transition: all 0.3s;
  z-index: 40;
}

.support-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 25px rgba(250, 204, 21, 0.5);
}

.support-btn i {
  font-size: 1.25rem;
}

/* ================================
   Animations
================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ================================
   Desktop / Tablet Breakpoint
================================ */
@media (min-width: 640px) {
  .back-text {
    display: inline;
  }

  .hero-icon {
    width: 6rem;
    height: 6rem;
  }

  .hero-icon i {
    font-size: 2.5rem;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .card {
    border-radius: 1.5rem;
    padding: 2rem;
  }

  .trust-badges {
    gap: 2rem;
  }

  .badge {
    font-size: 0.8125rem;
  }
}

@media (min-width: 768px) {
  .main {
    padding-top: 6rem;
  }

  .card {
    padding: 2.5rem;
  }
}
