* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --text-dark: #111827;
  --text-gray: #6b7280;
  --border-light: #e5e7eb;
  --bg-light: #f3f4f6;
}

html,
body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-light);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.register-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: white;
}

/* ==================== HEADER ==================== */
.auth-header {
  background: var(--primary-gradient);
  color: white;
  padding: 24px 20px;
  text-align: center;
  flex-shrink: 0;
}

.auth-header h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 14px;
  opacity: 0.9;
}

/* ==================== FORM SCROLL ==================== */
.form-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 20px;
}

.form-scroll::-webkit-scrollbar {
  width: 4px;
}

.form-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.form-scroll::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

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

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: block;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-dark);
  background: white;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
  color: #d1d5db;
}

.form-input[type="tel"] {
  font-family: monospace;
}

/* ==================== PROFILE IMAGE SECTION ==================== */
.profile-section {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #f3f0ff 0%, #f0f3ff 100%);
  border-radius: 14px;
  border: 1px solid #e9d5ff;
  margin-bottom: 16px;
}

.profile-image-viewer {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  background: white;
  border: 2px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-image-viewer:active {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.profile-image-viewer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-placeholder {
  font-size: 48px;
  color: #d1d5db;
}

.profile-input {
  display: none;
}

.profile-btn-text {
  font-size: 14px;
  color: var(--text-gray);
  margin-top: 8px;
}

/* ==================== GENDER SELECTION ==================== */
.gender-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gender-option {
  padding: 12px 14px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-gray);
  user-select: none;
  -webkit-user-select: none;
}

.gender-option:active {
  transform: scale(0.95);
}

.gender-option.selected {
  background: var(--primary-gradient);
  color: white;
  border-color: #667eea;
}

/* ==================== REGISTER FOOTER ==================== */
.auth-footer {
  padding: 20px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.btn-primary-auth {
  width: 100%;
  padding: 14px 16px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn-primary-auth:active {
  transform: scale(0.98);
  opacity: 0.8;
}

.btn-primary-auth:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary-auth.loading {
  position: relative;
  color: transparent;
}

.btn-primary-auth.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

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

/* ==================== TOGGLE LINK ==================== */
.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-gray);
}

.toggle-link {
  color: #667eea;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

/* ==================== ERROR STATE ==================== */
.form-input.error {
  border-color: #ef4444;
  background: #fef2f2;
}

.error-text {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}

.error-text.show {
  display: block;
}

/* ==================== SUCCESS MESSAGE ==================== */
.success-message {
  display: none;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  color: #15803d;
  font-size: 14px;
  margin-bottom: 16px;
}

.success-message.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 480px) {
  .auth-header {
    padding: 16px;
  }

  .auth-header h1 {
    font-size: 22px;
  }

  .form-scroll {
    padding: 16px;
  }

  .profile-image-viewer {
    width: 100px;
    height: 100px;
  }

  .profile-placeholder {
    font-size: 40px;
  }
}
