/* ============================================================
   auth.css  –  Shared styles for Login, Register, Forgot Password
   BytezTech Freelancer AutoPilot
   ============================================================ */

/* ---- Google Font: Inter ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  --ink: #0f1629;
  --muted: #64748b;
  --accent: #0d6e6e;
  --accent-2: #e07a5f;
  --accent-g: linear-gradient(135deg, #0d6e6e 0%, #0a9396 100%);
  --warm: linear-gradient(135deg, #f4a261 0%, #e07a5f 100%);
  --surface: rgba(255, 255, 255, 0.72);
  --border: rgba(15, 22, 41, 0.10);
  --shadow: 0 24px 60px rgba(15, 22, 41, 0.14);
  --radius: 22px;
  --radius-sm: 14px;
  --transition: 0.22s ease;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ---- Body ---- */
.auth-body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: #f0eadf;
}

/* ---- Animated background blobs ---- */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  animation: blobDrift 14s ease-in-out infinite alternate;
}

.blob-1 {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, rgba(13, 110, 110, 0.55), transparent 70%);
  top: -120px;
  left: -140px;
  animation-delay: 0s;
}

.blob-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(224, 122, 95, 0.50), transparent 70%);
  bottom: -80px;
  right: -100px;
  animation-delay: -5s;
}

.blob-3 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(10, 147, 150, 0.40), transparent 70%);
  top: 50%;
  right: 30%;
  animation-delay: -9s;
}

@keyframes blobDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(30px, -20px) scale(1.06);
  }

  100% {
    transform: translate(-20px, 30px) scale(0.96);
  }
}

/* ---- Wrapper ---- */
.auth-wrapper {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100vh;
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
  gap: 0;
}

.auth-wrapper-centered {
  max-width: 1160px;
}

/* ---- Brand / Left Panel ---- */
.auth-brand {
  background: linear-gradient(170deg, rgba(10, 20, 55, 0.97) 0%, rgba(13, 110, 110, 0.93) 100%);
  color: #fff;
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-g);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(13, 110, 110, 0.5);
}

.logo-text {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-heading {
  font-size: clamp(1.9rem, 2.8vw, 2.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.brand-sub {
  font-size: 0.94rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
}

.brand-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.brand-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.feat-icon {
  font-size: 1.05rem;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
}

.brand-link {
  color: #7fffd4;
  font-weight: 600;
  transition: color var(--transition);
}

.brand-link:hover {
  color: #fff;
}

/* ---- Auth Card / Right Panel ---- */
.auth-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: rgba(248, 243, 238, 0.6);
  backdrop-filter: blur(12px);
}

.auth-card-inner {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  animation: cardSlideIn 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---- Auth Tag (pill label) ---- */
.auth-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(13, 110, 110, 0.10);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ---- Titles ---- */
.auth-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ---- Alert box ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
  background: rgba(193, 18, 31, 0.1);
  color: #c1121f;
  border: 1px solid rgba(193, 18, 31, 0.18);
  line-height: 1.5;
}

.alert-success {
  background: rgba(45, 106, 79, 0.1);
  color: #2d6a4f;
  border-color: rgba(45, 106, 79, 0.18);
}

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

/* ---- Field group ---- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-link {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  transition: opacity var(--transition);
}

.field-link:hover {
  opacity: 0.72;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---- Input wrap ---- */
.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 1;
}

.field-input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 0.94rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.12);
}

.field-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.field-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748b' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 38px;
}

/* ---- Toggle password button ---- */
.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity var(--transition);
  padding: 4px;
  border-radius: 6px;
}

.toggle-pw:hover {
  opacity: 0.9;
}

/* ---- Primary button ---- */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-g);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 4px 16px rgba(13, 110, 110, 0.30);
  margin-top: 6px;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 110, 110, 0.38);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ---- Secondary / back buttons ---- */
.btn-secondary2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--warm);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(224, 122, 95, 0.30);
  margin-top: 14px;
}

.btn-secondary2:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(224, 122, 95, 0.38);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 10px 16px;
  font-size: 0.88rem;
  cursor: pointer;
  margin-top: 14px;
  transition: border-color var(--transition), color var(--transition);
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Copy button ---- */
.btn-copy {
  background: rgba(13, 110, 110, 0.10);
  border: 1px solid rgba(13, 110, 110, 0.22);
  border-radius: 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: rgba(13, 110, 110, 0.18);
}

/* ---- Spinner ---- */
.btn-spinner {
  font-size: 1.1rem;
  animation: spin 0.8s linear infinite;
}

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

/* ---- Alt link ---- */
.auth-alt-link {
  margin-top: 24px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-alt-link a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--transition);
}

.auth-alt-link a:hover {
  text-decoration-color: var(--accent);
}

/* ---- Token reveal section ---- */
.token-reveal {
  margin-top: 22px;
  padding: 20px;
  background: rgba(45, 106, 79, 0.06);
  border: 1px solid rgba(45, 106, 79, 0.2);
  border-radius: var(--radius-sm);
  animation: cardSlideIn 0.35s ease both;
}

.token-reveal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 1rem;
  color: #2d6a4f;
}

.token-check {
  font-size: 1.2rem;
}

.token-note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.token-box-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.token-box {
  flex: 1;
  min-height: 70px;
  border: 1.5px solid rgba(45, 106, 79, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--ink);
  resize: none;
  line-height: 1.5;
}

.token-box:focus {
  outline: none;
}

/* ---- Step section ---- */
.step-section {
  animation: cardSlideIn 0.38s ease both;
}

/* ---- Toast notification ---- */
.auth-toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  background: rgba(15, 22, 41, 0.95);
  color: #fff;
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
  z-index: 9999;
  max-width: 340px;
  line-height: 1.5;
  animation: toastIn 0.28s ease;
  backdrop-filter: blur(8px);
}

.auth-toast.toast-error {
  border-left: 4px solid #c1121f;
}

.auth-toast.toast-success {
  border-left: 4px solid #2d6a4f;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

/* ---- Responsive ---- */

/* Tablet (≤1024px) */
@media (max-width: 1024px) {
  .auth-wrapper {
    grid-template-columns: 300px 1fr;
  }

  .auth-brand {
    padding: 36px 24px;
  }

  .brand-heading {
    font-size: 1.85rem;
  }
}

/* Mobile Landscape / Small Tablet (≤860px) */
@media (max-width: 860px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .auth-brand {
    position: static;
    height: auto;
    min-height: unset;
    padding: 24px 22px 20px;
    overflow: visible;
  }

  .brand-heading {
    font-size: clamp(1.4rem, 6vw, 1.8rem);
  }

  .brand-features {
    display: none;
  }

  .brand-footer {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .auth-card {
    padding: 20px 14px 32px;
    align-items: flex-start;
  }

  .auth-card-inner {
    padding: 26px 20px;
    border-radius: 18px;
    max-width: 100%;
  }
}

/* Mobile Portrait (≤520px) */
@media (max-width: 520px) {
  .auth-brand {
    padding: 18px 16px 16px;
  }

  .brand-sub {
    display: none;
  }

  .auth-card {
    padding: 14px 8px 28px;
  }

  .auth-card-inner {
    padding: 20px 16px;
    border-radius: 14px;
  }

  .auth-title {
    font-size: 1.2rem;
  }

  .auth-subtitle {
    font-size: 0.84rem;
    margin-bottom: 18px;
  }

  .auth-form {
    gap: 14px;
  }

  .field-input {
    padding: 11px 12px 11px 38px;
    font-size: 0.9rem;
  }

  .btn-primary {
    padding: 13px 16px;
    font-size: 0.92rem;
  }

  .token-box-wrap {
    flex-direction: column;
  }

  .btn-copy {
    align-self: flex-start;
  }

  .auth-toast {
    left: 10px;
    right: 10px;
    bottom: 12px;
    max-width: unset;
    font-size: 0.84rem;
  }
}