/* ===== GLOBAL RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: color 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease,
    opacity 0.2s ease;
}

/* ===== BODY & BACKGROUND ===== */
body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: rgb(231, 238, 237);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

/* ===== MAIN CONTAINER ===== */
.container {
  background-color: rgb(231, 238, 237);
  border-radius: 0;
  padding: 0;
  width: 100vw;
  min-height: 100vh;
  box-shadow: none;
  border: none;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* ===== LEFT FORM SECTION ===== */
.form-section {
  flex: 1;
  padding: 60px 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: white;
  position: relative;
  max-width: 600px;
}

/* ===== RIGHT ILLUSTRATION SECTION ===== */
.illustration-section {
  flex: 1;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.illustration-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M 50 0 L 0 0 0 50" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.illustration-content {
  text-align: center;
  color: white;
  z-index: 2;
  position: relative;
  padding: 40px;
}

.illustration-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.illustration-content p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 40px;
  line-height: 1.6;
}

/* ===== DECORATIVE ELEMENTS ===== */
.floating-shape {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.floating-shape:nth-child(1) {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.floating-shape:nth-child(2) {
  width: 60px;
  height: 60px;
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.floating-shape:nth-child(3) {
  width: 100px;
  height: 100px;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

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

/* ===== PAGE MANAGEMENT ===== */
.page {
  display: none;
  animation: fadeInUp 0.5s ease-out;
  width: 100%;
}

.page.active {
  display: block;
}

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

/* ===== HEADINGS ===== */
h1 {
  margin-bottom: 10px;
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.025em;
}

/* ===== FORM GROUPS ===== */
.form-group {
  margin-bottom: 25px;
  position: relative;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ===== INPUT STYLING ===== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fafafa;
  color: #1f2937;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: white;
  transform: translateY(-1px);
}

input:disabled {
  background-color: #f1f5f9;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #e5e7eb;
}

/* ===== VERIFICATION GROUP ===== */
.verification-group {
  display: flex;
  gap: 12px;
  align-items: end;
}

.verification-group input {
  flex: 1;
}

/* ===== BUTTON STYLING (KEEPING YOUR ORIGINAL STYLE) ===== */
button {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: inherit;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Shimmer effect for buttons */
button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

button:hover:not(:disabled)::before {
  left: 100%;
}

/* Primary button styling */
button:not(.verification-btn) {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.4);
}

button:not(.verification-btn):hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px 0 rgba(59, 130, 246, 0.6);
}

button:not(.verification-btn):active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.4);
}

/* Verification button styling */
.verification-btn {
  width: auto;
  padding: 16px 20px;
  font-size: 0.85rem;
  min-width: 140px;
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(100, 116, 139, 0.4);
}

.verification-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px 0 rgba(100, 116, 139, 0.5);
}

.verification-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 14px 0 rgba(100, 116, 139, 0.4);
}

/* Disabled button state */
button:disabled {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%) !important;
  color: #9ca3af !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  opacity: 0.6;
}

button:disabled::before {
  display: none;
}

/* ===== SWITCH LINKS ===== */
.switch-link {
  text-align: center;
  margin-top: 30px;
  color: #6b7280;
  font-size: 0.95rem;
}

.switch-link a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.switch-link a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.switch-link a:hover {
  color: #1d4ed8;
  transform: translateY(-1px);
}

.switch-link a:hover::after {
  width: 100%;
}

/* ===== ERROR & SUCCESS MESSAGES ===== */
.error {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 8px;
  display: none;
  animation: slideIn 0.3s ease;
  font-weight: 500;
}

.success {
  color: #22c55e;
  font-size: 0.875rem;
  margin-top: 8px;
  display: none;
  animation: slideIn 0.3s ease;
  font-weight: 500;
}

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

/* ===== INPUT VALIDATION STATES ===== */
input:invalid:not(:focus) {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

input:valid:not(:placeholder-shown) {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

input.error-field {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
  animation: shake 0.4s ease-in-out;
}

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

/* ===== LOADING STATES ===== */
button.loading {
  pointer-events: none;
  position: relative;
}

button.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-left: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: currentColor;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .form-section {
    padding: 40px 100px;
    max-width: none;
  }

  .illustration-section {
    min-height: 300px;
    order: -1;
  }

  .illustration-content h2 {
    font-size: 2rem;
  }

  .illustration-content p {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .form-section {
    padding: 30px 70px;
  }

  h1 {
    font-size: 2rem;
  }

  .illustration-content {
    padding: 30px;
  }

  .illustration-content h2 {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .form-section {
    padding: 25px 50px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  .verification-group {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .verification-btn {
    width: 100%;
    min-width: auto;
  }

  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="tel"] {
    padding: 14px 16px;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  button {
    padding: 14px 20px;
    font-size: 0.9rem;
    min-height: 52px;
  }

  .illustration-section {
    min-height: 250px;
  }

  .illustration-content h2 {
    font-size: 1.5rem;
  }

  .illustration-content p {
    font-size: 0.9rem;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-contrast: high) {
  .form-section {
    border-right: 2px solid #1f2937;
  }

  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="tel"] {
    border: 2px solid #1f2937;
    background: white;
  }

  button {
    border: 2px solid transparent;
  }
}

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

  .floating-shape {
    animation: none;
  }
}

/* ===== FOCUS MANAGEMENT ===== */
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.7);
}
