/* ==========================================================================
   FlowSMS App — Split-Screen Auth (Samsung x NOWPayments Design Fusion)
   Left: Samsung Account floating card style · Right: Dark Modern Signal Dial
   ========================================================================== */

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

:root {
  --primary-blue: #60a5fa;
  --primary-blue-hover: #3b82f6;
  --primary-blue-active: #2563eb;
  
  --text-dark: #18181b;
  --text-body: #3f3f46;
  --text-muted: #71717a;
  --text-faint: #a1a1aa;
  
  --bg-left-pane: #f4f4f5;
  --bg-card: #ffffff;
  --border-light: #e4e4e7;
  --border-focus: #60a5fa;
  
  --radius-pill: 9999px;
  --radius-card: 28px;
  --radius-input: 8px;
  
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-family);
  color: var(--text-dark);
  background-color: var(--bg-left-pane);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Chrome/Safari Autofill Background Override */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 40px #ffffff inset !important;
  -webkit-text-fill-color: var(--text-dark) !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ---------- 50/50 Split-Screen Wrapper ---------- */
.login-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* ==========================================================================
   LEFT PANE: Samsung Account Inspired Auth Card
   ========================================================================== */
.login-left-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 36px;
  background-color: var(--bg-left-pane);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* Top Bar */
.login-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.brand-link:hover {
  opacity: 0.85;
}

.login-brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

/* Center Form Area */
.login-form-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  padding: 24px 0;
  width: 100%;
}

/* Floating White Card (Signature Samsung Account Style) */
.samsung-auth-card {
  width: 100%;
  max-width: 410px;
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 40px 36px 36px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.03);
  margin: 0 auto;
}

/* Samsung Header Group */
.samsung-header-group {
  text-align: center;
  margin-bottom: 28px;
}

.samsung-heading {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-dark);
  line-height: 1.25;
  margin-bottom: 6px;
}

.samsung-heading-sub {
  font-weight: 700;
}

.samsung-subheading {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 400;
}

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

.samsung-field-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.samsung-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-align: left;
}

.samsung-input {
  width: 100%;
  height: 46px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-input);
  padding: 0 14px;
  font-size: 14.5px;
  color: var(--text-dark);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.samsung-input::placeholder {
  color: var(--text-faint);
  font-size: 14px;
}

.samsung-input:hover {
  border-color: var(--text-faint);
}

.samsung-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.samsung-field-group.error .samsung-input {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.samsung-error-msg {
  display: none;
  font-size: 11.5px;
  font-weight: 500;
  color: #ef4444;
  margin-top: 4px;
  padding-left: 2px;
}
.samsung-field-group.error .samsung-error-msg {
  display: block;
}

/* Password Input & Eye Toggle */
.password-input-wrapper {
  position: relative;
  width: 100%;
  height: 46px;
}

.password-input-wrapper .password-input {
  padding-right: 48px;
}

/* Prevent Edge/IE duplicate native password reveal icon */
.password-input::-ms-reveal,
.password-input::-ms-clear {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.password-toggle-btn {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.password-toggle-btn:hover {
  color: var(--text-dark);
  background-color: #f4f4f5;
}
.password-toggle-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Eye Icon State Toggle (Crossed by default, Open when active) */
.password-toggle-btn .eye-visible {
  display: none;
}
.password-toggle-btn.is-active .eye-hidden {
  display: none;
}
.password-toggle-btn.is-active .eye-visible {
  display: block;
  color: #3b82f6;
}

/* Samsung "Remember my ID" Checkbox */
.remember-id-row {
  display: flex;
  align-items: center;
  margin-top: 2px;
  margin-bottom: 8px;
}

.samsung-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--text-body);
}

.samsung-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.samsung-checkbox-custom {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #a1a1aa;
  background-color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.samsung-checkbox-input:checked + .samsung-checkbox-custom {
  border-color: var(--primary-blue-hover);
  background-color: var(--primary-blue-hover);
}

.samsung-checkbox-input:checked + .samsung-checkbox-custom::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ffffff;
}

.samsung-checkbox-input:focus-visible + .samsung-checkbox-custom {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

/* Primary Samsung Pill Button */
.samsung-btn-group {
  margin-top: 4px;
}

.btn-samsung-pill-primary {
  width: 100%;
  height: 46px;
  background-color: var(--primary-blue);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(96, 165, 250, 0.25);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-samsung-pill-primary:hover {
  background-color: var(--primary-blue-hover);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
  transform: translateY(-1px);
}
.btn-samsung-pill-primary:active {
  transform: scale(0.99);
  background-color: var(--primary-blue-active);
}
.btn-samsung-pill-primary:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.btn-samsung-pill-primary:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
}

/* Samsung Navigation Links (Forgot password & Create account) */
.samsung-links-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 0;
}

.samsung-action-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.samsung-action-link:hover {
  color: var(--primary-blue-hover);
}
.samsung-action-link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Top 1-Click OAuth & Divider */
.top-oauth-wrap {
  margin-bottom: 4px;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0 20px;
  color: var(--text-faint);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-light);
}

.auth-divider span {
  padding: 0 14px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-transform: lowercase;
}

.btn-samsung-alt-pill {
  width: 100%;
  height: 46px;
  background-color: #f1f3f5;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-samsung-alt-pill:hover {
  background-color: #e9ecef;
  transform: translateY(-0.5px);
}
.btn-samsung-alt-pill:active {
  transform: scale(0.99);
}
.btn-samsung-alt-pill:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.alt-pill-icon-wrap {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.google-icon {
  width: 16px;
  height: 16px;
}

.alt-pill-text {
  letter-spacing: -0.01em;
}

/* Bottom Bar: Corporate Entity Left · Legal Links Right */
.login-bottom-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  padding-top: 16px;
  font-size: 12px;
  gap: 20px;
}

/* Corporate Registration Entity Block (Left side anchor) */
.company-entity-block {
  text-align: left;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
  flex-shrink: 0;
}

.entity-name {
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.entity-line {
  color: var(--text-muted);
}

/* Legal Links (Right side) */
.legal-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.legal-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
  transition: color 0.15s ease;
}
.legal-link:hover {
  color: var(--text-dark);
}
.legal-link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================================================
   RIGHT PANE: Dark Brand Container (50/50 Split Maintained)
   ========================================================================== */
.login-right-pane {
  padding: 20px;
  display: flex;
  background-color: var(--bg-left-pane);
}

.hero-brand-card {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 40px);
  min-height: calc(100dvh - 40px);
  background: radial-gradient(circle at 50% 45%, #151d2a 0%, #0d121a 100%);
  border-radius: var(--radius-card);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  text-align: center;
  color: #ffffff;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.25);
}

/* Floating Pastel Sparkle Stars (GPU-accelerated) */
.sparkle-star {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  animation: pulse-star 4s ease-in-out infinite alternate;
}

.star-pink {
  top: 28%;
  left: 17%;
  animation-delay: 0s;
}

.star-lime {
  top: 15%;
  right: 28%;
  animation-delay: 1.2s;
}

.star-blue {
  top: 64%;
  left: 14%;
  animation-delay: 2.4s;
}

.star-blue-alt {
  top: 32%;
  right: 14%;
  animation-delay: 0.8s;
}

.star-rose {
  bottom: 22%;
  right: 19%;
  animation-delay: 1.8s;
}

@keyframes pulse-star {
  0% { transform: scale(0.92) rotate(0deg); opacity: 0.8; }
  100% { transform: scale(1.08) rotate(6deg); opacity: 1; }
}

/* Background Outline Constellation Stars */
.sparkle-outline {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.star-outline-topleft {
  top: -40px;
  left: -40px;
}

.star-outline-bottomright {
  bottom: -60px;
  right: -50px;
}

.star-outline-centerright {
  top: 20%;
  right: 8%;
}

/* Center Graphic: Radiating Dial */
.hero-center-graphic {
  position: relative;
  width: 320px;
  height: 320px;
  max-width: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  z-index: 3;
}

.dial-ambient-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.16) 0%, rgba(8, 145, 178, 0.05) 50%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.sunburst-dial-svg {
  width: 100%;
  height: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  animation: slow-rotate 120s linear infinite;
  z-index: 2;
}

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

@media (prefers-reduced-motion: reduce) {
  .sunburst-dial-svg,
  .sparkle-star {
    animation: none;
  }
}

/* Center Brand Typography */
.hero-brand-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  pointer-events: none;
  z-index: 4;
}

.center-brand-flow {
  font-size: 34px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.center-brand-sms {
  font-size: 26px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

/* Value Proposition Heading */
.hero-tagline-wrap {
  position: relative;
  z-index: 3;
  margin-top: 14px;
}

.hero-tagline-lead {
  font-size: 18px;
  color: var(--text-faint);
  margin-bottom: 4px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-tagline-emphasis {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

/* Inline Link inside Labels */
.auth-inline-link {
  color: var(--text-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.auth-inline-link:hover {
  color: var(--primary-blue-hover);
}
.auth-inline-link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Reset Password Success Card */
.auth-success-card {
  display: none;
  text-align: center;
  padding: 8px 0;
}
.auth-success-card.is-visible {
  display: block;
  animation: fade-in-up 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.success-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: #ecfdf5;
  color: #10b981;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.success-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.success-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */
@media (max-width: 1180px) {
  .login-left-pane {
    padding: 24px 28px;
  }
  .login-right-pane {
    padding: 16px;
  }
  .hero-brand-card {
    padding: 32px 20px;
  }
  .hero-center-graphic {
    width: 270px;
    height: 270px;
  }
}

/* Mobile & Tablet Portrait (< 900px) */
@media (max-width: 900px) {
  .login-wrapper {
    grid-template-columns: 1fr;
  }

  .login-left-pane {
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    width: 100%;
  }

  .login-right-pane {
    display: none; /* Focus solely on auth form on mobile */
  }

  .samsung-auth-card {
    padding: 32px 22px 28px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
  }

  .samsung-heading {
    font-size: 22px;
  }

  /* Prevent automatic iOS Safari zoom on focus */
  .samsung-input {
    font-size: 16px;
  }

  .login-bottom-bar {
    flex-direction: column-reverse;
    align-items: flex-start;
    padding-top: 24px;
    gap: 16px;
  }

  .legal-links {
    justify-content: flex-start;
    gap: 14px;
  }

  .company-entity-block {
    text-align: left;
  }
}

/* Small Phones (< 380px) */
@media (max-width: 380px) {
  .samsung-auth-card {
    padding: 28px 16px 24px;
    border-radius: 20px;
  }

  .login-bottom-bar {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 12px;
  }

  .legal-links {
    gap: 12px;
  }
}

/* Accessibility: Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .sunburst-dial-svg,
  .sparkle-star {
    animation: none !important;
  }
}

/* ---------- Verification Code Input & Send Code Pill ---------- */
.label-split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.btn-get-code {
  background-color: var(--primary-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.4;
}

.btn-get-code:hover:not(:disabled) {
  background-color: var(--primary-blue-hover);
  transform: translateY(-0.5px);
}

.btn-get-code:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-get-code:disabled {
  background-color: #e4e4e7;
  color: #a1a1aa;
  cursor: not-allowed;
  transform: none;
}

.samsung-field-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
  display: block;
}
.samsung-field-hint.success {
  color: #16a34a;
  font-weight: 500;
}

