/**
 * Reset Password Website - Stylesheet
 * Developed by Start Application
 * @version 1.0.0
 * @copyright 2026 Start Application
 */

/* =========================================
   CSS Variables & Root
   ========================================= */
:root {
  /* Primary Colors */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;

  /* Status Colors */
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);

  /* Neutral Colors */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Gradients */
  --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;

  /* Font */
  --font-family:
    "Prompt", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =========================================
   Reset & Base Styles
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--gradient-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* =========================================
   Container & Background
   ========================================= */
.container {
  width: 100%;
  max-width: 440px;
  position: relative;
}

.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 20s infinite ease-in-out;
}

.circle-1 {
  width: 400px;
  height: 400px;
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.circle-2 {
  width: 300px;
  height: 300px;
  bottom: -150px;
  left: -100px;
  animation-delay: -5s;
}

.circle-3 {
  width: 200px;
  height: 200px;
  top: 50%;
  left: 20%;
  animation-delay: -10s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(30px, 30px) rotate(90deg);
  }
  50% {
    transform: translate(0, 60px) rotate(180deg);
  }
  75% {
    transform: translate(-30px, 30px) rotate(270deg);
  }
}

/* =========================================
   Card (Glassmorphism)
   ========================================= */
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem 2rem;
  position: relative;
  animation: slideUp 0.5s ease;
}

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

/* =========================================
   Language Toggle
   ========================================= */
.lang-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.25rem;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 0.25rem;
}

.lang-btn {
  background: transparent;
  border: none;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: var(--transition);
  font-family: var(--font-family);
}

.lang-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.lang-btn:hover:not(.active) {
  color: var(--gray-700);
}

/* =========================================
   Logo
   ========================================= */
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.logo {
  width: 64px;
  height: 64px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.logo svg {
  width: 32px;
  height: 32px;
  color: var(--white);
}

/* =========================================
   App Branding (when app selected from URL)
   ========================================= */
.app-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.app-branding-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-branding-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-branding-logo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 2rem;
  font-weight: 700;
}

.app-branding-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  text-align: center;
}

/* =========================================
   Title & Subtitle
   ========================================= */
.title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.subtitle {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

/* =========================================
   Step Progress
   ========================================= */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 0.5rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
}

.step.active .step-circle {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.step.completed .step-circle {
  background: var(--success);
  color: var(--white);
}

.step-label {
  font-size: 0.75rem;
  color: var(--gray-400);
  transition: var(--transition);
  white-space: nowrap;
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 500;
}

.step.completed .step-label {
  color: var(--success);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  min-width: 30px;
  max-width: 60px;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.step-line.completed {
  background: var(--success);
}

/* =========================================
   Alert
   ========================================= */
.alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

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

.alert.error {
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert.success {
  background: var(--success-bg);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert.warning {
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alert.error .alert-icon::before {
  content: "⚠️";
}

.alert.success .alert-icon::before {
  content: "✅";
}

.alert.warning .alert-icon::before {
  content: "⚡";
}

.alert-message {
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.5;
}

.alert-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: var(--transition);
}

.alert-close:hover {
  color: var(--gray-600);
}

/* =========================================
   Forms
   ========================================= */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* =========================================
   Method Toggle Tabs
   ========================================= */
.method-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--gray-100);
  padding: 0.25rem;
  border-radius: var(--radius-md);
}

.method-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-family);
  color: var(--gray-500);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.method-btn:hover {
  color: var(--gray-700);
}

.method-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.method-btn svg {
  width: 18px;
  height: 18px;
}

/* =========================================
   Form Groups
   ========================================= */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  pointer-events: none;
  transition: var(--transition);
}

.input-icon svg {
  width: 100%;
  height: 100%;
}

.input-wrapper input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  font-size: 1rem;
  font-family: var(--font-family);
  color: var(--gray-800);
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: var(--transition);
  outline: none;
}

.input-wrapper input::placeholder {
  color: var(--gray-400);
}

.input-wrapper input:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--primary);
}

.input-wrapper input.error {
  border-color: var(--error);
  background: var(--error-bg);
}

.input-wrapper input.error:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.input-error {
  display: block;
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 0.5rem;
  min-height: 1rem;
}

/* Toggle Password */
.toggle-password {
  position: absolute;
  right: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--gray-400);
  transition: var(--transition);
}

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

.toggle-password svg {
  width: 20px;
  height: 20px;
}

/* =========================================
   Password Strength Meter
   ========================================= */
.password-strength {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.strength-bar span {
  display: block;
  height: 100%;
  width: 0%;
  transition: var(--transition);
  border-radius: var(--radius-full);
}

.password-strength.weak .strength-bar span {
  width: 33%;
  background: var(--error);
}

.password-strength.medium .strength-bar span {
  width: 66%;
  background: var(--warning);
}

.password-strength.strong .strength-bar span {
  width: 100%;
  background: var(--success);
}

.strength-text {
  font-size: 0.75rem;
  color: var(--gray-500);
  white-space: nowrap;
}

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

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

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

/* =========================================
   OTP Inputs
   ========================================= */
.otp-info {
  text-align: center;
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.otp-email {
  text-align: center;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  font-family: var(--font-family);
  color: var(--gray-800);
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: var(--transition);
  outline: none;
}

.otp-input:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.otp-input.filled {
  border-color: var(--primary-light);
  background: rgba(99, 102, 241, 0.05);
}

.otp-input.error {
  border-color: var(--error);
  background: var(--error-bg);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-5px);
  }
}

.resend-otp {
  text-align: center;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: var(--font-family);
  transition: var(--transition);
}

.btn-link:disabled {
  color: var(--gray-400);
  cursor: not-allowed;
}

.btn-link:not(:disabled):hover {
  text-decoration: underline;
}

#resend-timer {
  color: var(--gray-400);
  margin-left: 0.25rem;
}

/* =========================================
   Buttons
   ========================================= */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-family);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--gray-600);
  border: 2px solid var(--gray-200);
  margin-top: 0.75rem;
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =========================================
   Success Screen
   ========================================= */
.success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.success-icon svg {
  width: 80px;
  height: 80px;
  color: var(--success);
  animation: successPop 0.5s ease;
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.success-message {
  text-align: center;
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* =========================================
   Footer
   ========================================= */
.footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

.footer p {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.footer a {
  color: var(--gray-500);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--primary);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 480px) {
  .card {
    padding: 2rem 1.5rem;
  }

  .step-label {
    font-size: 0.625rem;
  }

  .otp-input {
    width: 42px;
    height: 50px;
    font-size: 1.25rem;
  }

  .otp-inputs {
    gap: 0.375rem;
  }
}

@media (max-width: 360px) {
  .otp-input {
    width: 36px;
    height: 44px;
    font-size: 1.125rem;
  }

  .step-line {
    min-width: 20px;
  }
}

/* =========================================
   App List Styles
   ========================================= */

/* Search Input */
.app-search {
  position: relative;
  margin-bottom: 0.75rem;
}

.app-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  display: flex;
  align-items: center;
}

.app-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--white);
}

.app-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.app-search input::placeholder {
  color: var(--gray-400);
}

/* App List */
.app-list {
  max-height: 300px;
  overflow-y: auto;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--gray-50);
}

.app-list-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--gray-500);
}

.app-list-loading .spinner {
  width: 24px;
  height: 24px;
  border-color: var(--primary-light);
  border-top-color: var(--primary);
}

.app-list-empty {
  padding: 2rem;
  text-align: center;
  color: var(--gray-500);
}

.app-list-items {
  display: flex;
  flex-direction: column;
}

.app-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition);
  background: var(--white);
}

.app-item:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.app-item:last-child {
  border-bottom: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.app-item:only-child {
  border-radius: var(--radius-md);
}

.app-item:hover {
  background: var(--gray-50);
}

.app-item.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-light);
}

.app-item.selected:hover {
  background: rgba(99, 102, 241, 0.15);
}

.app-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-logo img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.app-logo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.app-name {
  flex: 1;
  font-weight: 500;
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.app-item.selected .app-check {
  background: var(--primary);
  border-color: var(--primary);
}

.app-check svg {
  width: 12px;
  height: 12px;
  color: var(--white);
  opacity: 0;
  transition: var(--transition);
}

.app-item.selected .app-check svg {
  opacity: 1;
}
