/**
 * Employee Portal V2 Styles
 * Subtle UI refresh + OTP input styling
 */

/* ============================================
   V2 UI REDESIGN - MAIN STYLES
   ============================================ */

/* Main container background */
body.index-page {
  background-color: #e6e6e0;
}

.hero {
  background: linear-gradient(135deg, #cfcfc8 0%, #d3d9d0 50%, #c5d3e0 100%) !important;
}

.dashboard,
.settings {
  background: #e6e6e0 !important;
}

/* All cards borderless, no shadow */
.card,
.icard {
  border: none;
  box-shadow: none;
}

/* Scroll margin for anchor links (accounts for fixed header) */
#mfa-help {
  scroll-margin-top: 100px;
}

/* Login page - fixed margins instead of vertical centering */
.hero {
  min-height: calc(100vh - 200px) !important;
  align-items: flex-start !important;
  padding-top: 180px !important;
  padding-bottom: 120px !important;
}

/* Ensure body/html background matches footer for any overflow */
body.index-page {
  background-color: #f1f1ee;
}

/* Login page cards - no shadow, no border, consistent border-radius */
.hero-header-form {
  border: none !important;
  box-shadow: none !important;
  border-radius: 8px !important;
}

.hero-header-form .card-footer {
  border-radius: 0 0 8px 8px !important;
}

/* Remove border from btn-default buttons on login page (except card footer) */
.hero .btn-default {
  border: none !important;
}

/* "Looking for main site" button - white default, header nav color on hover */
.hero h4 .btn-default {
  background-color: #fff !important;
  color: #000 !important;
  transition: background-color 0.15s ease;
}

.hero h4 .btn-default:hover,
.hero h4 .btn-default:focus {
  background-color: #bfbfb1 !important;
  color: #000 !important;
}

/* Card footer buttons need dark outline on light background */
.hero .card-footer .btn-default {
  border: 1px solid #32353a !important;
}

/* Card footer and modal footer white buttons - hover color */
.card-footer .btn-default:hover,
.card-footer .btn-default:focus,
.modal-body .btn-default:hover,
.modal-body .btn-default:focus {
  background-color: #e6e6e0 !important;
}

/* Login page text color - match dashboard dark text */
.hero {
  --color-default: #32353a;
  color: #32353a;
}

.hero h2,
.hero h4 {
  color: #32353a !important;
}

/* Modal headers - soft grey gradient */
.modal-header.ipaygradient {
  background: linear-gradient(135deg, #a4a49f 0%, #b5c1af 50%, #b2c2d2 100%) !important;
}

/* Modal content - no border */
.modal-content {
  border: none !important;
}

/* Modal close button - dark circle with white X */
.modal-header .close {
  background: #8da1ad;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  padding: 0;
  color: #fff;
  opacity: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-header .close:hover {
  background: #687d8a;
  color: #fff;
}

/* Dashboard header card - transparent, no border, no shadow */
.dashboard > .container > .align-top > .card {
  background: transparent;
  border: none;
  box-shadow: none;
}

.dashboard > .container > .align-top > .card > .card-body {
  background: transparent;
}

/* ============================================
   OTP INPUT BOXES
   ============================================ */

.otp-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.otp-box {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  background: #fff;
  color: #32353a;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

/* Remove spinner arrows on number inputs */
.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.otp-box:focus {
  border-color: #ce605c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(206, 96, 92, 0.15);
}

.otp-box.filled {
  border-color: #ce605c;
  background: #fef8f8;
}

/* Mobile responsive - slightly smaller boxes */
@media (max-width: 400px) {
  .otp-container {
    gap: 6px;
  }

  .otp-box {
    width: 42px;
    height: 50px;
    font-size: 20px;
  }
}

/* ============================================
   SUBTLE UI REFRESH
   ============================================ */

/* Cards - softer shadows */
.card-bg {
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.hero-header-form {
  border-radius: 12px;
}

/* Buttons - no shadows, smooth transitions */
.btn {
  transition: transform 0.15s ease, background 0.15s ease;
  box-shadow: none !important;
}

.btn:hover,
.btn:focus,
.btn:active {
  box-shadow: none !important;
}

.ipaygradient {
  transition: transform 0.15s ease;
}

.ipaygradient:hover {
  transform: translateY(-1px);
}

.ipaygradient:active {
  transform: translateY(0);
}

/* Modal headers should not have hover effects */
.modal-header.ipaygradient,
.modal-header.ipaygradient:hover,
.modal-header.ipaygradient:active {
  transform: none;
  box-shadow: none;
}

/* Form inputs - cleaner focus */
.form-control {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: #ce605c;
  box-shadow: 0 0 0 3px rgba(206, 96, 92, 0.1);
}

.form-floating > .form-control:focus ~ label {
  color: #ce605c;
}

/* Password visibility toggle */
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #6c757d;
  font-size: 18px;
  z-index: 10;
}

.password-toggle:hover {
  color: #32353a;
}

/* Alert boxes - softer styling */
.alert {
  border-radius: 10px;
  border: none;
}

.alert-danger {
  background: #f7e9e9;
  color: #33343a;
}

/* Card footer - cleaner */
.card-footer {
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
  border-radius: 0 0 12px 12px;
}

/* Loading spinner area */
#loginconnecting .card-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   2FA SECTION SPECIFIC
   ============================================ */

#2fa .alert {
  font-size: 14px;
  line-height: 1.5;
}

#2fa .card-body {
  padding-top: 24px;
  padding-bottom: 24px;
}

/* TOTP indicator text */
.totp-indicator {
  font-size: 13px;
  color: #6c757d;
  margin-top: 10px;
  text-align: center;
}

.totp-indicator i {
  margin-right: 4px;
}

/* ============================================
   SETTINGS PAGE MFA SECTION
   ============================================ */

.mfa-section {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  margin-bottom: 20px;
}

.mfa-section h5 {
  margin-bottom: 15px;
  color: #32353a;
}

.mfa-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.mfa-status.email {
  background: #e3f2fd;
  color: #1565c0;
}

.mfa-status.totp {
  background: #e8f5e9;
  color: #2e7d32;
}

/* Switch to Email Codes button - white text on hover */
#disable-totp-btn:hover {
  background: #ce605c;
  color: #fff !important;
  border-color: #ce605c !important;
}

/* Backup codes display */
.backup-codes {
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  background: #f5f5f5;
  padding: 15px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}

.backup-codes code {
  display: inline-block;
  background: #fff;
  padding: 4px 10px;
  margin: 4px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

/* QR code container */
.qr-container {
  text-align: center;
  padding: 20px;
}

.qr-container canvas {
  border: 8px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.manual-key {
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  background: #f5f5f5;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 13px;
  word-break: break-all;
  margin-top: 15px;
}

.manual-key-label {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 5px;
}

/* ============================================
   YEAR SELECTOR BUTTONS
   ============================================ */

.btn-yeardeselect {
  background-color: #bfbfb1 !important;
}

/* Selected year button - no hover/click effects */
.yearselect.ipaygradient,
.yearselect.ipaygradient:hover,
.yearselect.ipaygradient:focus,
.yearselect.ipaygradient:active,
.yearselect.ipaygradient:first-child:active {
  transform: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* ============================================
   SETTINGS PAGE - REMOVE BLUR/SHADOW EFFECT ON CARDS
   ============================================ */

.settings .card {
  background: #fff;
  box-shadow: none;
}

/* ============================================
   PAYSLIP/DOCUMENT CARDS - REMOVE BORDER
   ============================================ */

.icard {
  border: none !important;
}

.icard.is-loading {
  background: linear-gradient(110deg, #ffffff 40%, #f2f2f2 50%, #ffffff 60%);
  background-size: 200% 100%;
  animation: 1.5s shine linear infinite;
}

@keyframes shine {
  from {
    background-position-x: 0;
  }
  to {
    background-position-x: -200%;
  }
}

/* Document card View buttons */
.icard .btn-default {
  background-color: #e6e6e0 !important;
  border: none !important;
  color: #32353a !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icard .btn-default:hover,
.icard .btn-default:focus {
  background-color: #bfbfb1 !important;
  color: #fff !important;
}

/* ============================================
   HEADER - CONSTRAINED WIDTH
   ============================================ */

#header {
  background-color: #dfdfd7 !important;
  z-index: 1100 !important;
}

/* Header shadow when scrolling (scrolled class added to body by JS) */
body.scrolled #header {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* MFA announcement banner */
.mfa-banner {
  background: #5fa6cd;
  color: #fff;
  padding: 10px 0;
  font-size: 14px;
  position: fixed;
  top: 66px;
  left: 0;
  right: 0;
  z-index: 999;
}

.mfa-banner .container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 15px;
}

.mfa-banner a {
  color: #fff;
  text-decoration: underline;
}

.mfa-banner a:hover {
  color: #e0e0e0;
}

/* New badge for cards */
.new-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #5fa6cd;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Adjust main content when MFA banner is visible - add extra space for banner height */
body.mfa-banner-visible .dashboard {
  margin-top: 40px;
}

#header > .container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ============================================
   HEADER NAV BUTTONS - FLAT STYLE LIKE UNSELECTED YEAR
   ============================================ */

.header-nav-btn {
  background-color: #bfbfb1 !important;
  color: #000 !important;
  border: none !important;
  border-radius: 4px;
  font-size: 12px;
  padding: 9px 20px;
  margin-left: 10px;
  text-decoration: none;
  display: inline-block;
  transition: none !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
}

.header-nav-btn:hover,
.header-nav-btn:focus,
.header-nav-btn:focus-visible,
.header-nav-btn:active,
.header-nav-btn:first-child:active {
  background-color: #bfbfb1 !important;
  color: #000 !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
  transition: none !important;
  text-decoration: none;
}

/* ============================================
   HEADER LOGOUT BUTTON - GRADIENT, NO EFFECTS
   ============================================ */

.header-logout-btn {
  background: rgb(206,96,92);
  background: linear-gradient(144deg, rgba(206,96,92,1) 0%, rgba(206,92,142,1) 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px;
  font-size: 12px;
  padding: 9px 20px;
  margin-left: 10px;
  text-decoration: none;
  display: inline-block;
  transition: none !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
}

.header-logout-btn:hover,
.header-logout-btn:focus,
.header-logout-btn:focus-visible,
.header-logout-btn:active,
.header-logout-btn:first-child:active {
  background: rgb(206,96,92);
  background: linear-gradient(144deg, rgba(206,96,92,1) 0%, rgba(206,92,142,1) 100%) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  transform: none !important;
  transition: none !important;
  text-decoration: none;
}

/* Prevent scrollbar shift when modal opens */
body.modal-open {
  padding-right: 0 !important;
  overflow: auto !important;
}

body.modal-open #header {
  padding-right: 0 !important;
}

/* ============================================
   MOBILE HAMBURGER MENU
   ============================================ */

.header-hamburger {
  background: #bfbfb1 !important;
  border: none !important;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 20px;
  color: #000 !important;
  line-height: 1;
}

.header-hamburger:hover,
.header-hamburger:focus,
.header-hamburger:active {
  background: #bfbfb1 !important;
  color: #000 !important;
  box-shadow: none !important;
}

.header-mobile-menu .dropdown-menu {
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 180px;
}

.header-mobile-menu .dropdown-item {
  padding: 10px 16px;
  font-size: 14px;
}

.header-mobile-menu .dropdown-item:hover {
  background: #f5f5f5;
}

.header-mobile-menu .dropdown-item.text-danger:hover {
  background: #fef5f5;
}

.header-mobile-menu .dropdown-divider {
  margin: 4px 0;
}

/* ============================================
   FOOTER - LIGHT BACKGROUND
   ============================================ */

.footer {
  background: #f1f1ee !important;
}

.footer .footer-about p,
.footer .footer-copyright {
  color: #32353a;
}

.footer .footer-links a {
  color: #ce605c;
}

.footer .footer-links a:hover {
  color: #32353a;
}

.footer .social-links a {
  background: #ce605c;
  color: #fff;
}

.footer .social-links a:hover {
  background: #32353a;
  color: #fff;
}
