/* ===================================================
   RDOC – Shared Stylesheet  |  style.css
   Mobile-first · Pure CSS · Flexbox · Black theme
   =================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;          /* ← BLACK always */
  color: #e0e0e0;
}

/* ---------- Screen wrapper ---------- */
.screen {
  width: 100%;
  max-width: 390px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: linear-gradient(
    180deg,
    #131313 0%,
    #0e0e0e 50%,
    #080808 100%
  );
  position: relative;
  overflow: hidden;
}

/* ── subtle top accent glow ── */
.screen::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(32,194,220,.18) 0%, transparent 70%);
  pointer-events: none;
}

/* ---------- Login / Register container ---------- */
.login-container,
.register-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3.5rem 1.6rem 2.5rem;
  gap: 1.15rem;
}

/* ---------- Logo ---------- */
.logo-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1.8rem;
}

.logo-img {
  width: auto;
  max-width: 180px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(32, 194, 220, 0.35));
}

/* ---------- Form ---------- */
.login-form,
.register-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* ---------- Error banner ---------- */
.form-error {
  font-size: 0.8rem;
  color: #ff6b6b;
  text-align: center;
  min-height: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ---------- Input Group ---------- */
.input-group {
  width: 100%;
  background: #fff;
  border-radius: 2.5rem;
  display: flex;
  align-items: center;
  padding: 0 1.1rem;
  gap: 0.7rem;
  height: 3.4rem;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  border: 2px solid transparent;
}

.input-group:focus-within {
  box-shadow: 0 0 0 2px rgba(32, 194, 220, 0.55);
}

.input-group.has-error {
  border-color: #ff4d4d;
  box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.25);
}

.input-icon {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-icon svg {
  width: 100%;
  height: 100%;
  stroke: #20c2dc;
}

/* Floating label wrapper */
.input-content {
  flex: 1;
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

/* Label as centered placeholder */
.floating-label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 400;
  color: #aaa;
  letter-spacing: 0.01em;
  pointer-events: none;
  user-select: none;
  transition: top .2s ease, transform .2s ease, font-size .2s ease, color .2s ease;
  white-space: nowrap;
}

/* Float up on focus or when filled */
.text-input:focus ~ .floating-label,
.text-input:not(:placeholder-shown) ~ .floating-label {
  top: 0.55rem;
  transform: translateY(0);
  font-size: 0.65rem;
  color: #777;
  font-weight: 500;
}

.text-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: #1a1a1a;
  width: 100%;
  padding: 0;
  padding-top: 0.9rem;
  line-height: 1.2;
  -webkit-appearance: none;
}

.text-input::placeholder { color: transparent; }

/* Eye toggle */
.eye-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 1.15rem;
  height: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  transition: color 0.2s;
}
.eye-btn:hover { color: #555; }
.eye-btn svg { width: 100%; height: 100%; stroke: currentColor; }

/* Forgot password row */
.forgot-row {
  text-align: center;
  margin-top: -0.3rem;
}
.forgot-link {
  font-size: 0.78rem;
  color: #20c2dc;
  text-decoration: none;
  transition: opacity 0.2s;
}
.forgot-link:hover { opacity: 0.75; }

/* ---------- Primary Button ---------- */
.btn-primary {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 2.5rem;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #081014;
  background: linear-gradient(135deg, #1ecde0 0%, #12afc2 60%, #0d9aad 100%);
  box-shadow: 0 4px 20px rgba(18,175,194,.45), 0 1px 4px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  margin-top: 0.25rem;
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 28px rgba(18,175,194,.55), 0 2px 6px rgba(0,0,0,.3);
}
.btn-primary:active  { transform: scale(0.97); }
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ---------- Divider ---------- */
.divider-text {
  font-size: 0.82rem;
  color: #666;
  text-align: center;
  letter-spacing: 0.01em;
  margin: 0.2rem 0;
  position: relative;
}
.divider-text::before,
.divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 22%;
  height: 1px;
  background: #333;
}
.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

/* ---------- Social Buttons ---------- */
.social-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-social {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.4rem;
  border-radius: 2.5rem;
  border: 1px solid #2a2a2a;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.87rem;
  font-weight: 500;
  color: #d4d4d4;
  background: #161616;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.btn-social:hover {
  background: #1f1f1f;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  border-color: #333;
}
.btn-social:active { transform: scale(0.97); }

.social-icon {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.social-icon svg { width: 1.3rem; height: 1.3rem; }
#btn-facebook .social-icon { background: #1877F2; }

/* ---------- Create Account ---------- */
.create-account {
  margin-top: 0.5rem;
  text-align: center;
}
.create-account-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: #b0b0b0;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  position: relative;
}
.create-account-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #20c2dc;
  transition: width 0.25s ease;
}
.create-account-link:hover { color: #20c2dc; }
.create-account-link:hover::after { width: 100%; }

/* ─────────────────────────────────────────────
   OAUTH MODAL
──────────────────────────────────────────────*/
.oauth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.oauth-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.oauth-modal {
  width: 100%;
  max-width: 360px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 1.25rem;
  padding: 2rem 1.6rem;
  box-shadow: 0 24px 80px rgba(0,0,0,.9);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.28s cubic-bezier(.34,1.56,.64,1);
}
.oauth-overlay.visible .oauth-modal {
  transform: translateY(0) scale(1);
}

.oauth-step { display: flex; flex-direction: column; gap: 1.4rem; }
.oauth-step.hidden { display: none; }

.oauth-modal-header { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.oauth-provider-logo { width: 2rem; height: 2rem; }
.oauth-modal-title   { font-size: 1.1rem; font-weight: 700; color: #fff; text-align: center; }
.oauth-modal-sub     { font-size: 0.82rem; color: #888; text-align: center; }

/* OAuth fields */
.oauth-fields { display: flex; flex-direction: column; gap: 0.6rem; }

.oauth-field-wrap {
  position: relative;
  width: 100%;
}
.oauth-field {
  width: 100%;
  padding: 1rem 1rem 0.4rem;
  background: #1a1a1a;
  border: 1.5px solid #333;
  border-radius: 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.oauth-field:focus { border-color: #20c2dc; }
.oauth-field-label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: #666;
  pointer-events: none;
  transition: top .2s, transform .2s, font-size .2s, color .2s;
}
.oauth-field:focus ~ .oauth-field-label,
.oauth-field:not(:placeholder-shown) ~ .oauth-field-label {
  top: 0.5rem;
  transform: none;
  font-size: 0.65rem;
  color: #20c2dc;
}

.oauth-hint  { font-size: 0.75rem; color: #555; }
.oauth-forgot { font-size: 0.78rem; color: #20c2dc; text-decoration: none; display: inline-block; }
.oauth-forgot:hover { opacity: 0.75; }

/* OAuth action buttons */
.oauth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}
.oauth-btn-ghost {
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #20c2dc;
  cursor: pointer;
  padding: 0.55rem 1rem;
  border-radius: 2rem;
  transition: background 0.2s;
}
.oauth-btn-ghost:hover { background: rgba(32,194,220,.1); }

.oauth-btn-next {
  background: #20c2dc;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #081014;
  cursor: pointer;
  padding: 0.55rem 1.4rem;
  border-radius: 2rem;
  transition: filter 0.2s, transform 0.15s;
}
.oauth-btn-next:hover  { filter: brightness(1.1); }
.oauth-btn-next:active { transform: scale(0.97); }

/* Loading spinner */
.oauth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 1.5rem 0;
}
.oauth-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #2a2a2a;
  border-top-color: #20c2dc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.oauth-loading-txt { color: #888; font-size: 0.9rem; }

/* Success */
.oauth-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}
.oauth-check {
  width: 4rem;
  height: 4rem;
}
.oauth-check svg { width: 100%; height: 100%; }
.check-circle {
  stroke: #20c2dc;
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: drawCircle 0.6s ease forwards;
}
.check-tick {
  stroke: #20c2dc;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: drawTick 0.4s 0.5s ease forwards;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawTick   { to { stroke-dashoffset: 0; } }

.oauth-success-title { font-size: 1.2rem; font-weight: 700; color: #fff; }
.oauth-success-sub   { font-size: 0.85rem; color: #888; text-align: center; }
.oauth-btn-continue {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 2.5rem;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #081014;
  background: linear-gradient(135deg, #1ecde0, #0d9aad);
  transition: filter .2s, transform .15s;
}
.oauth-btn-continue:hover  { filter: brightness(1.08); }
.oauth-btn-continue:active { transform: scale(0.97); }

/* ─────────────────────────────────────────────
   REGISTER PAGE EXTRAS
──────────────────────────────────────────────*/
.back-link-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.back-link {
  font-size: 0.82rem;
  color: #666;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s;
}
.back-link:hover { color: #20c2dc; }
.back-link svg { width: 1rem; height: 1rem; }

.register-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: 0.01em;
}
.register-subtitle {
  font-size: 0.82rem;
  color: #666;
  text-align: center;
  margin-top: -0.5rem;
}

/* Terms checkbox */
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0 0.2rem;
}
.terms-checkbox {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  accent-color: #20c2dc;
  cursor: pointer;
}
.terms-label {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.5;
}
.terms-label a { color: #20c2dc; text-decoration: none; }
.terms-label a:hover { opacity: 0.8; }

/* Login link row */
.login-row {
  text-align: center;
  font-size: 0.83rem;
  color: #666;
}
.login-row a { color: #20c2dc; text-decoration: none; font-weight: 600; }
.login-row a:hover { opacity: 0.8; }

/* Password strength bar */
.strength-bar-wrap {
  display: flex;
  gap: 4px;
  padding: 0 0.4rem;
  margin-top: -0.3rem;
}
.strength-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: #2a2a2a;
  transition: background 0.3s;
}
.strength-seg.weak   { background: #ff4d4d; }
.strength-seg.medium { background: #ffb347; }
.strength-seg.strong { background: #20c2dc; }

/* ─────────────────────────────────────────────
   RESPONSIVE
──────────────────────────────────────────────*/
@media (max-width: 375px) {
  .login-container,
  .register-container { padding: 3rem 1.3rem 2rem; }
  .logo-img { max-width: 150px; }
  .btn-primary { font-size: 0.95rem; }
}

@media (min-width: 480px) {
  body {
    padding: 2rem 1rem;
    align-items: flex-start;
    justify-content: center;
  }
  .screen {
    border-radius: 2rem;
    min-height: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04);
    margin: 2rem auto;
  }
}
