/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #0a0b0d; /* Official Coinbase Dark Theme Background */
  --text-color: #ffffff;
  --label-color: #ffffff;
  --input-bg: #0a0b0d; /* Same background for inputs as page */
  --input-border: #2d3139; /* Zinc-800 style border */
  --input-focus-border: #0052ff; /* Coinbase Blue focus */
  --primary-blue-disabled: #132142; /* Disabled navy */
  --primary-blue-enabled: #0052ff; /* Coinbase Blue */
  --primary-blue-hover: #0045db;
  --text-muted: #8f96a3; /* Muted gray for requirements */
  --text-active: #ffffff;
  --transition-speed: 0.15s;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3.5px solid #1e2025;
  border-top: 3.5px solid var(--primary-blue-enabled);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Header & Back Button */
.header {
  width: 100%;
  max-width: 440px;
  padding: 12px 0 32px 0;
  display: flex;
  justify-content: flex-start;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-speed);
}

.back-btn:hover {
  opacity: 0.8;
}

/* Container & Form Wrapper */
.container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 40px;
}

.form-wrapper {
  width: 100%;
}

.title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 40px;
  letter-spacing: -0.5px;
  text-align: left;
}

/* Input Fields styling */
.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.input-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--label-color);
  margin-bottom: 12px;
}

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

.password-input-wrapper input {
  width: 100%;
  padding: 18px 16px;
  padding-right: 48px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 16px;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.password-input-wrapper input::placeholder {
  color: #555c68;
}

.password-input-wrapper input:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 1px var(--input-focus-border);
}

.password-input-wrapper.error input {
  border-color: #ef4444;
}

.password-input-wrapper.error input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px #ef4444;
}

.password-input-wrapper input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Eye Toggle Button */
.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #8f96a3;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

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

.hidden {
  display: none !important;
}

/* Requirements list */
.requirements-list {
  list-style: none;
  margin: -8px 0 28px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.requirement {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.requirement .check-icon {
  flex-shrink: 0;
  stroke: var(--text-muted);
  transition: stroke var(--transition-speed);
}

/* Active / Valid Requirement State */
.requirement.valid {
  color: var(--text-color);
}

.requirement.valid .check-icon {
  stroke: #0052ff; /* Coinbase Blue for valid checks */
}

/* Error message for matching password */
.error-msg {
  font-size: 13px;
  color: #ef4444;
  margin-top: 8px;
  display: none;
  animation: fadeIn 0.15s ease-in-out;
}

/* Submit button */
.submit-btn {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 9999px; /* Pill shaped */
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  background-color: var(--primary-blue-disabled);
  color: #435475;
  margin-top: 16px;
}

.submit-btn:not(:disabled) {
  background-color: var(--primary-blue-enabled);
  color: #ffffff;
}

.submit-btn:not(:disabled):hover {
  background-color: var(--primary-blue-hover);
}

.submit-btn:disabled {
  background-color: var(--primary-blue-disabled);
  color: #435475;
  cursor: not-allowed;
}

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

/* Success State */
.success-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 60px;
}

.success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.checkmark-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #5082f6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.checkmark-icon {
  stroke: #ffffff;
}

.success-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.success-message {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 32px;
}

.success-btn {
  background-color: #5082f6;
  color: #0a0b0d;
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: 9999px;
  padding: 18px;
  width: 100%;
  max-width: 260px;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.success-btn:hover {
  background-color: #4372e5;
}

/* OTP Wrapper */
.otp-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.otp-description {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: -24px;
  margin-bottom: 32px;
}

.otp-description .user-email {
  color: #ffffff;
  font-weight: 600;
}

.otp-input-section {
  width: 100%;
  margin-bottom: 32px;
}

.otp-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--label-color);
  display: block;
  margin-bottom: 12px;
}

.otp-inputs {
  display: flex;
  gap: 12px;
  width: 100%;
}

.otp-field {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 56px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.otp-field:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 1px var(--input-focus-border);
}

.resend-btn {
  width: 100%;
  max-width: 260px;
  padding: 18px;
  border: none;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 600;
  background-color: #1a1b1f;
  color: var(--text-muted);
  cursor: not-allowed;
  margin-bottom: 32px;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.resend-btn.active {
  background-color: var(--primary-blue-enabled);
  color: #ffffff;
  cursor: pointer;
}

.resend-btn.active:hover {
  background-color: var(--primary-blue-hover);
}

.otp-footer {
  width: 100%;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
}

.otp-footer .update-link {
  color: #5082f6;
  text-decoration: none;
  font-weight: 600;
}

.otp-footer .update-link:hover {
  text-decoration: underline;
}

/* Fade out for form */
.fade-out {
  animation: fadeOut 0.15s ease-in-out forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.98); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  body {
    padding: 16px;
  }
  .title {
    font-size: 28px;
    margin-bottom: 32px;
  }
  .password-input-wrapper input {
    padding: 16px;
  }
}

