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

:root {
  --x-bg: #000000;
  --x-modal-bg: #16181c;
  --x-border: #2f3336;
  --x-text: #e7e9ea;
  --x-text-dim: #71767b;
  --x-blue: #1d9bf0;
  --x-white-hover: rgba(239, 243, 244, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--x-bg);
  color: var(--x-text);
  font-size: 15px;
  line-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

/* Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(4px);
  z-index: 40;
}

/* Modal */
.modal-surface {
  position: relative;
  z-index: 50;
  background: var(--x-modal-bg);
  border: 0.5px solid var(--x-border);
  border-radius: 25px;
  width: 700px;
  height: 664px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Layout */
.h-full { height: 100%; }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.relative { position: relative; }

/* Header */
.header-section {
  padding: 8px 16px 0;
}

.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--x-text);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.back-button:hover {
  background: var(--x-white-hover);
}

.back-button svg {
  width: 20px;
  height: 20px;
}

/* Scrollable Area */
.jf-vscroller {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.jf-vscroller::-webkit-scrollbar {
  width: 0;
}

/* Content */
.content-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 32px;
  min-height: 100%;
}

/* Logo */
.logo-container {
  display: flex;
  justify-content: center;
  margin: 5px 0 20px;
}

.logo-container svg {
  width: 42px;
  height: 42px;
  fill: var(--x-text);
}

/* Main Content */
.main-wrapper {
  width: 100%;
  max-width: 364px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.inner-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Title */
.title-container {
  margin-bottom: 32px;
}

.title {
  font-size: 31px;
  font-weight: 700;
  line-height: 36px;
  color: var(--x-text);
}

/* Form */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Input Fields */
.jf-float-wrapper {
  background: transparent;
  border: 2px solid var(--x-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  min-height: 64px;
  transition: border-color 0.2s;
  position: relative;
}

.jf-float-wrapper:focus-within {
  border-color: var(--x-blue);
}

.jf-float-wrapper.error {
  border-color: #f4212e;
}

.jf-float-wrapper.error:focus-within {
  border-color: #f4212e;
}

.jf-float-wrapper.error .jf-float-label {
  color: #f4212e !important;
}

.jf-float-label-container {
  flex: 1;
  padding: 12px 16px 4px;
  display: flex;
  flex-direction: column;
}

.jf-float-label {
  font-size: 13px;
  line-height: 16px;
  color: var(--x-text-dim);
  margin-bottom: 4px;
  transition: color 0.2s;
}

.jf-float-wrapper:focus-within .jf-float-label {
  color: var(--x-blue);
}

.jf-float-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--x-text);
  font-size: 17px;
  line-height: 24px;
  font-family: inherit;
  width: 100%;
  padding: 0;
}

.jf-float-input:disabled {
  opacity: 1;
  -webkit-text-fill-color: var(--x-text);
}

/* Password Field */
.password-field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.password-input-container {
  position: relative;
}

.error-message {
  display: none;
  align-items: center;
  gap: 8px;
  color: #f4212e;
  font-size: 13px;
  line-height: 16px;
  margin-top: 8px;
}

.error-message.show {
  display: flex;
}

.error-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.jf-password-toggle {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--x-text-dim);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

.jf-password-toggle:hover {
  color: var(--x-text);
}

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

/* Forgot Password */
.forgot-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--x-text);
  font-size: 15px;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}

.forgot-btn:hover {
  text-decoration: underline;
}

/* Spacer */
.flex-spacer {
  flex: 1;
}

/* Button Section */
.button-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 48px;
}

.continue-btn {
  width: 100%;
  min-height: 52px;
  background: #eff3f4;
  color: #0f1419;
  border: none;
  border-radius: 26px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
}

.continue-btn:disabled {
  background: var(--x-border);
  color: var(--x-text-dim);
  cursor: not-allowed;
}

.continue-btn:not(:disabled):hover {
  background: #d7dbdc;
}

/* Terms */
.terms-text {
  font-size: 11px;
  line-height: 14px;
  color: var(--x-text-dim);
  text-align: center;
}

.terms-text a {
  color: var(--x-text);
  text-decoration: none;
  font-weight: 700;
}

.terms-text a:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 700px) {
  .modal-surface {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
  
  .content-outer {
    padding: 0 20px;
  }
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

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