/* ---- Reset & Variables ---- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --bg1: #0b1020;
  --bg2: #151e3d;
  --accent1: #8b5cf6;
  --accent2: #06b6d4;
  --text-light: #ffffff;
  --text-muted: #cbd5e1;
  --text-dark: #0f172a;
  --border-light: rgba(255, 255, 255, 0.12);
  --border-dark: rgba(0, 0, 0, 0.1);
  --glass: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}
body.light-mode {
  --bg1: #f8fafc;
  --bg2: #e2e8f0;
  --accent1: #7c3aed;
  --accent2: #0891b2;
  --text-light: #1e293b;
  --text-muted: #64748b;
  --text-dark: #f1f5f9;
  --border-light: rgba(0, 0, 0, 0.08);
  --border-dark: rgba(255, 255, 255, 0.8);
  --glass: rgba(0, 0, 0, 0.05);
}
body {
  font-family: "Poppins", sans-serif;
  min-height: 100vh;
  background: radial-gradient(circle at top right, var(--bg2), var(--bg1));
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  line-height: 1.6;
  transition: background var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}
/* Typography Scale (Fluid) */
h1, h2, h3 {
  font-weight: 600;
  line-height: 1.2;
}
h1 {
  font-size: clamp(1.5rem, 4vw, 1.75rem);
}
h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}
p {
  font-size: clamp(0.875rem, 2vw, 0.95rem);
  color: var(--text-muted);
}
/* Page Container */
.page {
  width: 100%;
  display: flex;
  justify-content: center;
  animation: fadeInUp 0.8s ease;
}
/* Card */
.card {
  width: 420px;
  max-width: calc(100% - 48px);
  background: var(--glass);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 5vw, 28px);
  box-shadow: var(--shadow-xl);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent1), var(--accent2), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.card:hover::before {
  opacity: 1;
}
.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(139, 92, 246, 0.2);
  border-color: var(--accent1);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.05), rgba(6, 182, 212, 0.05));
}
/* Logo Container */
.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.logo-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent1);
  opacity: 0;
  transition: opacity var(--transition-slow), transform var(--transition-normal);
  animation: fadeInScale 0.6s ease-out forwards;
}
.logo-icon.loaded {
  opacity: 1;
}
.brand h1 {
  text-align: center;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  animation: slideInText 0.4s ease-out 0.2s both;
}
.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.875rem;
  animation: slideInText 0.4s ease-out 0.4s both;
}
/* CTA area */
.cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  animation: slideInText 0.4s ease-out 0.6s both;
}
.button-group {
  display: flex;
  gap: 12px;
  width: 100%;
}
.btn {
  flex: 1;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 0;
  font-weight: 600;
  letter-spacing: 0.25px;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
  font-family: inherit;
  text-align: center;
  touch-action: manipulation;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  transform: scale(1.02) translateY(-1px);
  box-shadow: var(--shadow-lg);
  outline: none;
}
.btn-outline {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border-light);
}
.btn-outline:hover,
.btn-outline:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
  outline: none;
}
/* ---- Overlay and modal ---- */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  z-index: 50;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
.overlay[aria-hidden="false"] {
  display: grid;
}
.modal {
  width: 100%;
  max-width: 500px;
  background: var(--glass);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: slideIn var(--transition-slow);
  color: var(--text-light);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg {
  max-width: 780px;
}
/* close */
.modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover,
.modal-close:focus-visible {
  color: var(--accent1);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transform: scale(1.1);
}
/* header */
.modal h2 {
  margin-bottom: 16px;
  text-align: center;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideInText 0.4s ease-out both;
}
/* profile area */
.profile-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  gap: 8px;
}
.pfp-wrapper {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 2px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  background: var(--glass);
  backdrop-filter: blur(10px);
  cursor: pointer;
}
.pfp-wrapper:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
  border-color: var(--accent1);
}
.pfp-wrapper.pfp-drag {
  border-color: var(--accent2);
  transform: scale(1.04);
  background: rgba(6, 182, 212, 0.1);
}
.pfp-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
  opacity: 0;
}
.pfp-wrapper img.has-image,
.pfp-wrapper img.loaded {
  opacity: 1;
  transform: scale(1);
  animation: fadeInScale 0.6s ease-out both;
}
.pfp-placeholder-text {
  position: absolute;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 8px;
  line-height: 1.2;
  opacity: 0.8;
  transition: opacity var(--transition-normal);
  animation: slideInText 0.4s ease-out both;
}
.pfp-wrapper:hover .pfp-placeholder-text {
  opacity: 1;
}
/* edit icon inside circle */
.edit-icon {
  position: absolute;
  right: 6px;
  bottom: 6px;
  border-radius: 999px;
  border: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.edit-icon svg {
  color: var(--text-light);
  opacity: 0.9;
}
.edit-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
  border-color: var(--accent1);
}
.edit-icon:active {
  transform: scale(0.98);
}
/* hide native input */
.pfp-wrapper input[type="file"] {
  display: none;
}
/* small hint */
.pfp-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}
/* form layout */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.field input,
.field select {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
  min-height: 48px;
}
.field.password-field {
  position: relative;
}
.field.password-field input {
  padding-right: 48px;
}
.field select {
  padding: 16px 16px;
  font-size: 1.05rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  appearance: none;
}
.field input::placeholder,
.field select option {
  color: var(--text-muted);
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
  background: rgba(255, 255, 255, 0.08);
}
.username-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.at {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-light);
  font-weight: 600;
}
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  transition: color var(--transition-fast);
  z-index: 1;
}
.password-toggle:hover {
  color: var(--accent1);
}
.password-toggle svg {
  width: 20px;
  height: 20px;
}
/* Terms Section */
.terms-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
  overflow: hidden;
}
.terms-section:hover {
  border-color: var(--accent1);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.1);
}
.terms-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 12px;
  user-select: none;
}
.terms-label input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0 0;
  border: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.terms-label input[type="checkbox"] + .checkmark {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  margin-right: 8px;
  position: relative;
  transition: all var(--transition-fast);
}
.terms-label input[type="checkbox"]:checked + .checkmark {
  background: var(--accent1);
  border-color: var(--accent1);
}
.terms-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}
.terms-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--accent2);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 10px 12px;
  transition: all var(--transition-normal);
  width: 100%;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.terms-toggle:hover,
.terms-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent1);
  color: var(--accent1);
  outline: none;
  transform: translateY(-1px);
}
.terms-toggle .toggle-text {
  flex: 1;
}
.terms-toggle .chevron {
  font-size: 0.75rem;
  transition: transform var(--transition-normal);
  margin-left: 8px;
  flex-shrink: 0;
}
.terms-section.expanded .terms-toggle .chevron {
  transform: rotate(180deg);
}
.terms-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), opacity var(--transition-normal), padding var(--transition-normal);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  padding: 0 0 0 28px;
}
.terms-section.expanded .terms-content {
  max-height: 600px;
  opacity: 1;
  padding: 12px 0;
}
.terms-inner {
  scrollbar-width: thin;
  scrollbar-color: var(--accent1) var(--glass);
}
.terms-inner::-webkit-scrollbar {
  width: 4px;
}
.terms-inner::-webkit-scrollbar-track {
  background: var(--glass);
}
.terms-inner::-webkit-scrollbar-thumb {
  background: var(--accent1);
  border-radius: 2px;
}
.terms-content p {
  margin-bottom: 8px;
  text-align: justify;
}
.terms-content a {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.terms-content a:hover {
  color: var(--accent1);
  text-decoration: underline;
}
/* form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.form-actions .btn {
  min-width: 100px;
}
/* Responsive */
@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .card {
    width: 100%;
    padding: 20px;
  }
  body {
    padding: 20px;
  }
  .button-group {
    flex-direction: column;
  }
  .btn {
    min-height: 48px;
    padding: 16px 20px;
  }
  .form-actions {
    justify-content: center;
  }
  .form-actions .btn {
    width: 100%;
  }
  .modal {
    padding: 20px;
  }
  .terms-section.expanded .terms-content {
    max-height: 500px;
  }
}
/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideIn {
  from {
    transform: translateY(25px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInText {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --glass: rgba(255, 255, 255, 0.15);
  }
  body.light-mode {
    --glass: rgba(0, 0, 0, 0.1);
  }
  .card,
  .modal,
  .pfp-wrapper,
  .btn-outline,
  .terms-toggle {
    border-width: 2px;
  }
  .terms-section {
    border-width: 2px;
  }
}
/* Print Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .overlay,
  .button-group .btn-outline {
    display: none;
  }
  .card,
  .modal {
    box-shadow: none;
    border: 1px solid black;
  }
}