/* ==========================================================================
   BOS Unified Sign-In Page - Identifier-First Flow
   Spec: page-21 mockup - Split card layout with hero panel
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
}

/* --------------------------------------------------------------------------
   Login Page Layout - Fullscreen Split
   -------------------------------------------------------------------------- */
.login-page {
  display: flex;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: #1a1a1a;
}

/* --------------------------------------------------------------------------
   Fullscreen Split Container
   -------------------------------------------------------------------------- */
.login-card {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Left Hero Panel - ~75% width
   -------------------------------------------------------------------------- */
.login-hero {
  flex: 1 1 75%;
  min-width: 0;
  position: relative;
  background-color: #1a1a1a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  color: #fff;
}

/* Flipped background image + dark overlay via pseudo-element.
   scaleX(-1) mirrors the photo; the gradient provides the dark overlay.
   Content (.login-hero-content, z-index:2) sits above both layers. */
.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
    url('../images/Newfurn_Office_Background.jpg') center/cover no-repeat;
  transform: scaleX(-1);
  z-index: 0;
}

.login-hero-content {
  position: relative;
  z-index: 2;
}

.login-hero-brand {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 16px;
  color: #fff;
}

.login-hero-logo {
  max-width: 320px;
  width: 100%;
  height: auto;
  margin-bottom: 24px;
}

.login-hero-tagline {
  font-size: 18px;
  color: #fff;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Right Auth Panel - ~25% width
   -------------------------------------------------------------------------- */
.login-auth-panel {
  flex: 1 1 25%;
  min-width: 500px;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  padding: 3em;
  background: #fff;
}

/* BOS Logo at top */
.login-logo {
  margin-bottom: 32px;
}

.login-logo img {
  height: 70px;
  width: auto;
}

/* For inline SVG BOS logo */
.login-logo-bos {
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-logo-bos .logo-icon {
  width: 40px;
  height: 40px;
}

.login-logo-bos .logo-text {
  font-size: 28px;
  font-weight: 700;
  color: #333;
}

/* Heading */
.login-heading {
  font-size: 22px;
  font-weight: 600;
  color: #222;
  margin: 0 0 24px 0;
}

/* Form area */
.login-form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Field label */
.login-field-label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  margin-left: 8px;
}

/* Input field */
.login-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: #fafafa;
  color: #333;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input::placeholder {
  color: #999;
}

.login-input:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
  background-color: #fff;
}

/* Primary button (Next) */
.login-btn-primary {
  width: 100%;
  min-height: 45px;
  padding: 10px 24px;
  margin-top: 30px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background-color: #0078d4;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.login-btn-primary:hover {
  background-color: #006cbe;
}

.login-btn-primary:active {
  transform: translateY(1px);
}

.login-btn-primary:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Copyright footer */
.login-footer {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
  font-size: 12px;
  color: #888;
}

/* --------------------------------------------------------------------------
   Modern Auth Flow Steps
   -------------------------------------------------------------------------- */
.login-step {
  display: none;
}

.login-step.active {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Error message */
.login-error {
  padding: 12px 16px;
  margin-bottom: 16px;
  background-color: #fef0f0;
  border: 1px solid #fdd;
  border-radius: 6px;
  color: #c00;
  font-size: 13px;
}

.login-error.hidden {
  display: none;
}

/* --------------------------------------------------------------------------
   Auth Method Selection (Step 2)
   -------------------------------------------------------------------------- */
.auth-methods {
  margin: 16px 0;
}

.auth-method-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin: 8px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-method-btn:hover {
  border-color: #0078d4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-method-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-method-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.auth-method-content {
  flex: 1;
}

.auth-method-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.auth-method-desc {
  font-size: 12px;
  color: #666;
}

/* User greeting (Step 2) */
.user-greeting {
  text-align: center;
  margin-bottom: 20px;
}

.user-greeting-name {
  font-weight: 600;
  font-size: 18px;
  color: #333;
}

.user-greeting-email {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

/* Back link - Orange to match brand */
.back-link {
  display: inline-block;
  font-size: 13px;
  color: #0078d4;
  cursor: pointer;
  text-decoration: none;
  margin-top: 16px;
}

.back-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   OTP Input (Step 3b)
   -------------------------------------------------------------------------- */
.otp-input {
  width: 220px;
  font-size: 24px;
  text-align: center;
  letter-spacing: 8px;
  padding: 12px 16px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Password Step (Step 3a)
   -------------------------------------------------------------------------- */
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: #555;
}

.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.login-forgot {
  margin-top: 8px;
  text-align: right;
}

.login-forgot a {
  font-size: 13px;
  color: #0078d4;
  text-decoration: none;
}

.login-forgot a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Loading spinner
   -------------------------------------------------------------------------- */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Legacy form fallback styles (when needed for downstream flows)
   -------------------------------------------------------------------------- */
.login-form-fields {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: #fafafa;
  margin-bottom: 12px;
}

.login-form-login-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background-color: #0078d4;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.login-form-reset-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background-color: #666;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .login-card {
    flex-direction: column;
    min-height: 100vh;
  }

  .login-hero {
    flex: 0 0 auto;
    min-height: 220px;
    padding: 40px 32px;
  }

  .login-hero-brand {
    font-size: 32px;
  }

  .login-hero-logo {
    max-width: 200px;
  }

  .login-auth-panel {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 40px 32px;
  }
}

@media (max-width: 480px) {
  .login-hero {
    min-height: 180px;
    padding: 32px 24px;
  }

  .login-hero-logo {
    max-width: 160px;
  }

  .login-hero-tagline {
    font-size: 15px;
  }

  .login-auth-panel {
    padding: 32px 24px;
  }
}

/* --------------------------------------------------------------------------
   Utility classes
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-auto {
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   Password visibility toggle
   -------------------------------------------------------------------------- */
.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper .login-input {
  display: block;
  width: 100%;
  padding-right: 44px;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-btn:hover {
  color: #333;
}

.password-toggle-btn:focus {
  outline: none;
}

.eye-icon {
  display: block;
}

/* --------------------------------------------------------------------------
   Redesigned Method Selection Screen
   -------------------------------------------------------------------------- */
.method-selection-heading {
  font-size: 20px;
  font-weight: 700;
  color: #222;
  margin: 0 0 24px 0;
}

#step-system .method-selection-heading {
  margin-bottom: 8px;
}

#step-system .login-field-group {
  margin-top: 16px;
}

#step-system .login-field-group + .login-field-group {
  margin-top: 16px;
}

.method-selection-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Method Section */
.method-section {
  margin-top: 50px;
}

.method-section:first-child {
  margin-top: 0;
}

.method-section-header {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 500;
}

/* Password Inline Section */
.method-password-inline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.method-password-inline .password-input-wrapper {
  width: 100%;
}

/* Primary Button (Orange/Red) */
.method-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 45px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background-color: #0078d4;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.method-btn-primary:hover {
  background-color: #006cbe;
}

.method-btn-primary:active {
  transform: translateY(1px);
}

.method-btn-primary:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Half-width buttons for OTP row */
.method-otp-buttons {
  display: flex;
  gap: 12px;
}

.method-btn-half {
  flex: 1;
  min-width: 0;
}

/* Green Button (OTP) */
.method-btn-green {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 45px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background-color: #388e3c;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.method-btn-green:hover {
  background-color: #2e7d32;
}

.method-btn-green:active {
  transform: translateY(1px);
}

.method-btn-green:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Dark Button (Charcoal) */
.method-btn-dark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 45px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background-color: #2d2d2d;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.method-btn-dark:hover {
  background-color: #404040;
}

.method-btn-dark:active {
  transform: translateY(1px);
}

.method-btn-dark:disabled {
  background-color: #666;
  cursor: not-allowed;
}

/* SSO Button Stacking */
.method-btn-sso {
  margin-top: 10px;
}

.method-btn-sso:first-of-type {
  margin-top: 0;
}

/* Button Icons */
.method-btn-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.method-btn-svg {
  flex-shrink: 0;
  vertical-align: middle;
}

.method-btn-icon-qr {
  font-size: 14px;
}

/* SSO Provider Icons */
.method-btn-icon-sso {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Microsoft 4-color Logo (CSS-based) */
.method-btn-icon-microsoft {
  position: relative;
  width: 16px;
  height: 16px;
}

.method-btn-icon-microsoft::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  background: 
    linear-gradient(to right, #f25022 0%, #f25022 50%, #7fba00 50%, #7fba00 100%) top,
    linear-gradient(to right, #00a4ef 0%, #00a4ef 50%, #ffb900 50%, #ffb900 100%) bottom;
  background-size: 100% 50%;
  background-repeat: no-repeat;
}

/* Google G Logo (SVG inline via CSS) */
.method-btn-icon-google {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   OTP Screen Redesign
   -------------------------------------------------------------------------- */
.otp-subtext {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin: 0 0 8px 0;
}

.otp-target-display {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin: 0 0 20px 0;
}

.otp-target-display strong {
  color: #333;
}

.otp-countdown {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin: 20px 0 10px 0;
  font-weight: 500;
}

.otp-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.otp-actions .back-link {
  margin-top: 0;
}

.resend-link {
  font-size: 13px;
  color: #e65100;
  cursor: pointer;
  text-decoration: none;
}

.resend-link:hover {
  text-decoration: underline;
}

.otp-expired-message {
  padding: 12px 16px;
  margin-bottom: 20px;
  background-color: #fef0f0;
  border: 1px solid #fdd;
  border-radius: 6px;
  color: #c00;
  font-size: 14px;
  text-align: left;
}

/* --------------------------------------------------------------------------
   Passkey Screen
   -------------------------------------------------------------------------- */
.passkey-subtext {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin: 0 0 24px 0;
}

.passkey-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  font-size: 14px;
  color: #555;
  margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   Responsive adjustments for method selection
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .method-otp-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .method-btn-half {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Searchable Select Dropdown
   -------------------------------------------------------------------------- */
.searchable-select-container {
  position: relative;
  width: 100%;
}

.searchable-select-trigger {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: #fafafa;
  color: #333;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.searchable-select-trigger:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
  background-color: #fff;
}

.searchable-select-trigger:disabled {
  background-color: #f1f1f1;
  color: #888;
  cursor: not-allowed;
  border-color: #e2e2e2;
}

.searchable-select-arrow {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.searchable-select-container.open .searchable-select-arrow {
  transform: rotate(180deg);
}

.searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 6px;
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  max-height: 280px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.searchable-select-container.open .searchable-select-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.searchable-select-search-wrapper {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  display: flex;
  align-items: center;
}

.searchable-select-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background-color: #f8fafc;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, background-color 0.2s;
}

.searchable-select-search-input:focus {
  border-color: #0078d4;
  background-color: #fff;
}

.searchable-select-search-icon {
  position: absolute;
  left: 22px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.searchable-select-options {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  max-height: 200px;
}

.searchable-select-options::-webkit-scrollbar {
  width: 6px;
}
.searchable-select-options::-webkit-scrollbar-track {
  background: transparent;
}
.searchable-select-options::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}
.searchable-select-options::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.searchable-select-option {
  padding: 12px 16px;
  font-size: 14.5px;
  color: #334155;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.searchable-select-option:hover,
.searchable-select-option.highlighted {
  background-color: #f1f5f9;
  color: #0f172a;
}

.searchable-select-option.selected {
  background-color: #e2e8f0;
  color: #0f172a;
  font-weight: 600;
}

.searchable-select-option .checkmark-icon {
  color: #0078d4;
  flex-shrink: 0;
  margin-left: 8px;
}

.searchable-select-no-results {
  padding: 16px;
  font-size: 14px;
  color: #64748b;
  text-align: center;
}
