/* ============================================================
   FirePulse — Register Styles (v12 — Final)
   Layout order: Photo → Name → Username → Google Card → Agreement
   ============================================================ */

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background: #000000;
  color: #ffffff;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  overscroll-behavior: none;
}

/* ============================================================
   REGISTER SECTION
   ============================================================ */
.register-section {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  background: #000000;
}
.register-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 16px;
  padding: 28px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: boxFade 0.4s ease-out;
}
@keyframes boxFade {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   BRANDING
   ============================================================ */
.register-brand { text-align: center; margin-bottom: 22px; }
.brand-logo {
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid #2a2a2a; padding: 8px; background: #0a0a0a;
  margin: 0 auto 10px; display: flex; align-items: center;
  justify-content: center; overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-name {
  font-size: 22px; font-weight: 800; color: #ffffff;
  letter-spacing: 0.5px; margin: 0;
}
.brand-name span { color: #ff0000; }
.brand-tagline {
  font-size: 12px;
  color: #888888;
  margin: 3px 0 0;
}
.brand-description {
  font-size: 13px;
  color: #999999;
  line-height: 1.6;
  margin: 12px auto 0;
  max-width: 360px;
  text-align: center;
  padding: 0 4px;
}

/* ============================================================
   ERROR MESSAGE
   ============================================================ */
.register-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
  color: #ff4444;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ============================================================
   GOOGLE SIGNUP BUTTON
   ============================================================ */
.btn-google-signup {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 50px;
  margin-bottom: 16px;
}
.btn-google-signup:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #c6c6c6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}
.btn-google-signup:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}
.btn-google-signup:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-google-signup svg { flex-shrink: 0; }

/* ============================================================
   INFO BOX
   ============================================================ */
.register-info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.register-info-box i {
  color: #3b82f6;
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}
.register-info-box > div { flex: 1; min-width: 0; }
.register-info-box strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}
.register-info-box p {
  font-size: 12px;
  color: #aaaaaa;
  line-height: 1.55;
  margin: 0;
}

/* ============================================================
   FOOTER LINK
   ============================================================ */
.register-footer {
  text-align: center;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid #1a1a1a;
  font-size: 13px;
  color: #888888;
}
.register-footer p { margin: 0; }
.register-footer a {
  color: #ff0000;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.25s ease;
}
.register-footer a:hover {
  color: #cc0000;
  text-decoration: underline;
}

/* ============================================================
   AUTH-CALLBACK WRAP
   ============================================================ */
.auth-callback-wrap {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: boxFade 0.4s ease-out;
}
.auth-callback-wrap::-webkit-scrollbar { width: 4px; }
.auth-callback-wrap::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }

/* ============================================================
   STATE: LOADING — Ring animation around logo
   ============================================================ */
.state-loading {
  text-align: center;
  padding: 30px 20px 20px;
}

.loading-logo-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ff0000;
  background: #0a0a0a;
  z-index: 2;
  position: relative;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.35);
}

.loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #ff0000;
  border-right-color: #ff0000;
  animation: ringSpin 1s linear infinite;
  z-index: 1;
}

@keyframes ringSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.state-loading h1 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 6px;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.state-loading p {
  color: #888888;
  font-size: 13px;
  margin: 0;
}

/* ============================================================
   STATE: FORM
   ============================================================ */
.state-form { display: none; }

.auth-brand { text-align: center; margin-bottom: 14px; }
.auth-logo {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid #ff0000; margin-bottom: 8px;
  object-fit: cover; background: #111;
}
.auth-brand h1 {
  font-size: 20px; font-weight: 800;
  color: #ffffff; margin: 0;
}
.auth-brand h1 span { color: #ff0000; }

.auth-header {
  text-align: center; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid #1a1a1a;
}
.auth-header h2 {
  font-size: 18px; font-weight: 700;
  color: #ffffff; margin: 0 0 4px;
}
.auth-header p { font-size: 12px; color: #888888; margin: 0; }

/* ============================================================
   PHOTO UPLOAD SECTION (Top)
   ============================================================ */
.photo-upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px 0 18px;
  border-bottom: 1px solid #1a1a1a;
  margin-bottom: 18px;
}

.photo-label {
  font-size: 11px;
  font-weight: 700;
  color: #cccccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.photo-label i { color: #ff0000; }
.photo-label .optional {
  color: #666666;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.photo-label-bottom {
  margin-top: 4px;
  margin-bottom: 0;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.image-upload-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.image-upload-preview {
  position: relative;
  width: 110px;
  height: 110px;
  border: 2px dashed #2a2a2a;
  border-radius: 50%;
  background: #111111;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-upload-preview:hover {
  border-color: #ff0000;
  background: #161616;
}
.image-upload-preview.has-image {
  border-style: solid;
  border-color: #2a2a2a;
}
.image-upload-preview img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.upload-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; color: #666; text-align: center;
  padding: 8px;
}
.upload-placeholder i {
  font-size: 24px; color: #ff0000;
  margin-bottom: 2px;
}
.upload-placeholder span {
  font-size: 11px; font-weight: 600; color: #cccccc;
}
.upload-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px; color: #fff; font-size: 10px;
  text-align: center; padding: 8px;
  font-weight: 500; border-radius: 50%;
}
.upload-overlay i { font-size: 22px; color: #ff0000; }
.upload-overlay.success i { color: #44ff44; }
.upload-overlay.error i { color: #ff4444; }
.upload-overlay.error {
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid #ff4444;
}
.image-upload-actions {
  display: flex; gap: 8px;
}
.btn-upload-change,
.btn-upload-remove {
  padding: 7px 14px; border-radius: 8px;
  font-size: 11px; font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all 0.3s ease;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid #333; background: #1a1a1a; color: #fff;
}
.btn-upload-change:hover { border-color: #ff0000; color: #ff0000; }
.btn-upload-remove:hover { border-color: #ff4444; color: #ff4444; }

/* ============================================================
   FORM GROUP
   ============================================================ */
.form-group {
  display: flex; flex-direction: column;
  gap: 4px; margin-bottom: 14px;
}
.form-group label {
  display: flex; align-items: center;
  gap: 8px; font-size: 12px;
  font-weight: 600; color: #cccccc;
}
.form-group label i {
  color: #666666; width: 16px;
  font-size: 13px; text-align: center;
}
.required { color: #ff0000; }

.form-input {
  width: 100%; background: #111111;
  border: 1px solid #2a2a2a; border-radius: 10px;
  padding: 12px 14px; font-size: 14px;
  color: #ffffff; font-family: 'Inter', sans-serif;
  transition: border-color 0.3s ease;
  outline: none; height: 46px;
}
.form-input::placeholder { color: #555555; }
.form-input:focus { border-color: #ff0000; }
.form-input.error { border-color: #ff4444; }

/* ============================================================
   USERNAME INPUT
   ============================================================ */
.input-wrapper { position: relative; }
.username-prefix {
  position: absolute; left: 12px;
  top: 50%; transform: translateY(-50%);
  color: #666666; font-size: 14px;
  font-weight: 600; z-index: 2;
  pointer-events: none;
}
.username-input { padding-left: 30px; }
.username-status {
  position: absolute; right: 12px;
  top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 600;
  white-space: nowrap; z-index: 2;
}
.username-status.available { color: #44ff44; }
.username-status.taken { color: #ff4444; }
.username-status.checking { color: #ffaa00; }

/* ============================================================
   FIELD ERRORS
   ============================================================ */
.field-error {
  font-size: 11px; color: #ff4444;
  display: none; margin-top: 2px;
}
.field-error:not(:empty) { display: block; }
.field-hint {
  font-size: 11px; color: #555555; margin-top: 2px;
}

/* ============================================================
   GOOGLE USER CARD
   ============================================================ */
.google-user-card {
  display: flex; align-items: center;
  gap: 14px; background: #111111;
  border: 1px solid #1a1a1a; border-radius: 12px;
  padding: 14px; margin-bottom: 16px;
}
.google-user-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; border: 2px solid #4285F4;
  flex-shrink: 0; background: #222;
}
.google-user-info { flex: 1; min-width: 0; }
.google-user-name {
  font-size: 15px; font-weight: 700;
  color: #ffffff; margin: 0 0 2px;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.google-user-email {
  font-size: 12px; color: #888888; margin: 0;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis;
}
.google-verified-badge {
  display: inline-flex; align-items: center;
  gap: 4px; font-size: 10px; color: #22c55e;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.1);
  padding: 2px 8px; border-radius: 10px;
  margin-top: 4px;
}

/* ============================================================
   AGREEMENT SECTION
   ============================================================ */
.agreement-section {
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 14px;
  margin: 0 0 14px;
}
.checkbox-label {
  display: flex; align-items: flex-start;
  gap: 10px; font-size: 13px;
  color: #cccccc; cursor: pointer;
  line-height: 1.5; position: relative;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkbox-label .checkmark {
  width: 18px; height: 18px; min-width: 18px;
  border: 2px solid #444444; border-radius: 4px;
  background: #111111; display: inline-block;
  position: relative; top: 1px;
  transition: all 0.3s ease;
}
.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: #ff0000; border-color: #ff0000;
}
.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff; font-size: 11px;
}
.checkbox-label .checkmark:hover { border-color: #ff0000; }
.checkbox-label a { color: #ff0000; text-decoration: none; }
.checkbox-label a:hover { text-decoration: underline; }

/* ============================================================
   AUTH ERROR / SUCCESS
   ============================================================ */
.auth-error, .auth-success {
  display: flex; align-items: center;
  gap: 8px; padding: 12px 14px;
  border-radius: 10px; font-size: 13px;
  margin-bottom: 14px; line-height: 1.4;
}
.auth-error {
  background: rgba(255, 0, 0, 0.08);
  border: 1px solid rgba(255, 0, 0, 0.25);
  color: #ff6666;
}
.auth-success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #22c55e;
}

/* ============================================================
   SUBMIT BUTTON
   ============================================================ */
.btn-submit {
  width: 100%; padding: 14px;
  background: #ff0000; color: #ffffff;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all 0.25s ease;
  min-height: 50px; display: flex;
  align-items: center; justify-content: center;
  gap: 8px;
}
.btn-submit:hover:not(:disabled) {
  background: #cc0000;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 0, 0, 0.3);
}
.btn-submit:disabled {
  opacity: 0.6; cursor: not-allowed; transform: none;
}

/* ============================================================
   STATE: ERROR
   ============================================================ */
.state-error { text-align: center; padding: 20px 0; }
.state-error .error-icon {
  font-size: 56px; color: #ff4444;
  margin-bottom: 12px;
}
.state-error h1 {
  font-size: 20px; font-weight: 800;
  margin: 8px 0 8px; color: #ffffff;
}
.state-error p {
  color: #888888; font-size: 13px;
  margin-bottom: 20px;
}
.btn-back {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
  padding: 12px 28px; background: #ff0000;
  color: #ffffff; border: none;
  border-radius: 10px; font-size: 14px;
  font-weight: 700; font-family: 'Inter', sans-serif;
  text-decoration: none; cursor: pointer;
  transition: all 0.25s ease;
}
.btn-back:hover { background: #cc0000; transform: translateY(-2px); }

/* ============================================================
   RESPONSIVE — Short screens
   ============================================================ */
@media (max-height: 700px) {
  .register-wrapper { padding: 22px 18px; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-name { font-size: 19px; }
  .brand-description { font-size: 12px; margin-top: 8px; }
  .btn-google-signup { padding: 12px 18px; min-height: 46px; font-size: 14px; margin-bottom: 12px; }
  .register-info-box { padding: 11px 13px; margin-bottom: 12px; }
  .register-info-box strong { font-size: 12px; }
  .register-info-box p { font-size: 11px; }
  .register-brand { margin-bottom: 16px; }
  .register-footer { padding-top: 12px; }
}

@media (max-height: 600px) {
  .register-wrapper { padding: 18px 16px; }
  .brand-logo { width: 46px; height: 46px; padding: 6px; }
  .brand-name { font-size: 17px; }
  .brand-description { font-size: 11px; margin-top: 6px; }
  .btn-google-signup { padding: 11px 16px; min-height: 42px; font-size: 13px; }
  .register-info-box { padding: 10px 12px; }
  .register-info-box i { font-size: 16px; }
  .register-footer { font-size: 12px; padding-top: 10px; }
}

/* ============================================================
   RESPONSIVE — Mobile (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  body { padding: 12px; }
  .register-wrapper { padding: 24px 18px; }
  .auth-callback-wrap { padding: 22px 18px; max-width: 100%; }

  .brand-logo { width: 54px; height: 54px; padding: 7px; }
  .brand-name { font-size: 19px; }
  .brand-description { font-size: 12px; margin-top: 10px; }

  .btn-google-signup {
    font-size: 14px;
    padding: 13px 16px;
    min-height: 48px;
    gap: 10px;
  }
  .btn-google-signup svg { width: 18px; height: 18px; }

  .register-info-box { padding: 12px 14px; gap: 10px; }
  .register-info-box i { font-size: 18px; }
  .register-info-box strong { font-size: 12px; }
  .register-info-box p { font-size: 11px; }

  .loading-logo-wrap { width: 100px; height: 100px; }
  .loading-logo { width: 68px; height: 68px; }
  .state-loading h1 { font-size: 17px; }
  .state-loading p { font-size: 12px; }

  .auth-logo { width: 50px; height: 50px; }
  .auth-brand h1 { font-size: 18px; }
  .auth-header h2 { font-size: 16px; }
  .auth-header p { font-size: 11px; }

  .google-user-card { padding: 12px; gap: 12px; }
  .google-user-avatar { width: 46px; height: 46px; }
  .google-user-name { font-size: 14px; }
  .google-user-email { font-size: 11px; }

  .image-upload-preview { width: 96px; height: 96px; }
  .upload-placeholder i { font-size: 22px; }
  .upload-placeholder span { font-size: 10px; }
  .image-upload-actions { flex-direction: column; width: 100%; }
  .btn-upload-change,
  .btn-upload-remove {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
  }

  .form-group label { font-size: 11px; }
  .form-input { height: 44px; font-size: 13px; padding: 11px 12px; }
  .username-input { padding-left: 26px; }
  .username-prefix { left: 10px; font-size: 13px; }

  .agreement-section { padding: 12px; }
  .checkbox-label { font-size: 12px; }
  .checkbox-label .checkmark { width: 16px; height: 16px; min-width: 16px; }

  .btn-submit {
    font-size: 14px;
    min-height: 46px;
    padding: 13px;
  }

  .state-error .error-icon { font-size: 48px; }
  .state-error h1 { font-size: 18px; }
  .state-error p { font-size: 12px; }
}

/* ============================================================
   RESPONSIVE — Small Mobile (≤360px)
   ============================================================ */
@media (max-width: 360px) {
  .register-wrapper { padding: 20px 14px; }
  .auth-callback-wrap { padding: 18px 14px; }

  .brand-logo { width: 46px; height: 46px; padding: 6px; }
  .brand-name { font-size: 17px; }
  .brand-description { font-size: 11px; margin-top: 8px; }

  .btn-google-signup {
    font-size: 13px;
    padding: 12px 14px;
    min-height: 44px;
    gap: 8px;
  }
  .btn-google-signup svg { width: 16px; height: 16px; }

  .register-info-box { padding: 10px 12px; }
  .register-info-box i { font-size: 16px; }
  .register-info-box strong { font-size: 11px; }
  .register-info-box p { font-size: 10px; }

  .loading-logo-wrap { width: 90px; height: 90px; }
  .loading-logo { width: 60px; height: 60px; }
  .state-loading h1 { font-size: 16px; }
  .state-loading p { font-size: 11px; }

  .auth-logo { width: 46px; height: 46px; }
  .auth-brand h1 { font-size: 16px; }
  .auth-header h2 { font-size: 15px; }

  .google-user-avatar { width: 42px; height: 42px; }
  .google-user-name { font-size: 13px; }
  .google-user-email { font-size: 10px; }

  .image-upload-preview { width: 84px; height: 84px; }
  .upload-placeholder i { font-size: 20px; }

  .form-input { height: 42px; font-size: 12px; }
  .btn-submit { font-size: 13px; min-height: 44px; }

  .checkbox-label { font-size: 11px; }
  .checkbox-label .checkmark { width: 15px; height: 15px; min-width: 15px; }
}

/* END OF register.css */