/* Modern Login Styles - Sunrise ERP */

/* Variables for Sunrise ERP theme */
:root {
  --primary: #FF6B35;         /* Sunrise Orange */
  --accent: #F7931E;          /* Warm Orange */
  --font-primary: 'Poppins', sans-serif;
  --font-secondary: 'Montserrat', sans-serif;
  --text-dark: #1F2937;
  --text-medium: #6B7280;
  --bg-light: #F9FAFB;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-full: 9999px;
  --transition-normal: 0.2s ease;
  --gradient-primary: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  --success: #10B981;
  --danger: #EF4444;
}

/* Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Logo Styles */
.logo {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
  text-decoration: none;
}

.logo-text {
  font-family: var(--font-secondary);
  letter-spacing: -0.5px;
}

.logo .accent {
  color: var(--accent);
}

/* Body Styles */
body {
  font-family: var(--font-primary);
  background: linear-gradient(to bottom right, #f8f9fa, #e9ecef);
  color: var(--text-dark);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.section-padding {
  padding: 60px 0;
}

/* Header Styles */
#header.fixed,
#header {
  padding: 8px 0;
  height: 67.2px;
  box-shadow: var(--shadow-sm);
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #fff;
}

#header .container {
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

.auth-buttons .btn {
  padding: 6px 14px;
  font-size: 0.9rem;
  min-height: 32px;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* Main Login Area */
.login-page {
  padding-top: 85px;
  padding-bottom: 30px;
  min-height: calc(100vh - 85px);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.login-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.row.align-items-center {
  align-items: center;
}

.col-lg-6 {
  width: 50%;
  padding: 0 15px;
  position: relative;
}

/* Left Column - Welcome Content */
.login-content {
  padding-right: 30px;
}

.welcome-badge {
  display: inline-block;
  background: rgba(255, 107, 53, 0.1);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 500;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.welcome-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.2;
}

.company-slogan {
  margin-bottom: 20px;
}

.slogan-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 5px;
  font-style: italic;
}

.slogan-subtitle {
  font-size: 1rem;
  color: var(--text-medium);
  font-weight: 400;
}

.welcome-description {
  font-size: 1rem;
  color: var(--text-medium);
  margin-bottom: 25px;
  line-height: 1.6;
}

.login-features {
  margin-top: 30px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 18px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 107, 53, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
  transition: all var(--transition-normal);
}

.feature-item:hover .feature-icon {
  background: var(--primary);
  color: white;
  transform: translateY(-5px);
}

.feature-text h3 {
  font-size: 1rem;
  margin-bottom: 3px;
  font-weight: 600;
}

.feature-text p {
  color: var(--text-medium);
  font-size: 0.9rem;
  margin: 0;
}

/* Right Column - Login Form */
.login-form-container {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px 25px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  backdrop-filter: blur(5px);
  background: rgba(255, 255, 255, 0.95);
  max-width: 380px;
  margin-left: auto;
  margin-right: 0;
}

.login-form-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--gradient-primary);
  z-index: -1;
}

.login-form-container:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.form-header {
  text-align: center;
  margin-bottom: 18px;
}

.form-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.form-header p {
  color: var(--text-medium);
  font-size: 0.88rem;
  margin: 0;
}

/* Form Elements - Enhanced for Mobile */
.form-group {
  margin-bottom: 12px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 0.88rem;
}

.input-field {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-medium);
  pointer-events: none;
  z-index: 2;
  font-size: 0.9rem;
}

.input-field input {
  width: 100%;
  padding: 9px 38px 9px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  height: 38px;
  line-height: 1.5;
  box-sizing: border-box;
  transition: all 0.3s ease;
  background: var(--bg-light);
  -webkit-appearance: none; /* Remove iOS styling */
  -moz-appearance: none; /* Remove Firefox styling */
  appearance: none;
}

.input-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
  outline: none;
  background: white;
}

.toggle-password {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-medium);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 12px;
  z-index: 2;
  line-height: 1;
  -webkit-tap-highlight-color: transparent; /* Remove iOS tap highlight */
}

.toggle-password:hover,
.toggle-password:focus {
  color: var(--primary);
  outline: none;
}

.error-message {
  font-size: 0.85rem;
  color: var(--danger);
  margin-top: 5px;
  min-height: 18px;
}

/* Form Options - Enhanced for Mobile */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* Remove iOS tap highlight */
  position: relative;
  padding: 5px; /* Increase touch target */
  margin: -5px; /* Compensate for padding */
}

.checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-custom {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: white;
  margin-right: 8px;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checkbox input:checked ~ .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox input:focus ~ .checkbox-custom {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.checkbox-custom::after {
  content: '';
  position: absolute;
  display: none;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox input:checked ~ .checkbox-custom::after {
  display: block;
}

.checkbox-label {
  font-size: 0.85rem;
  user-select: none;
  color: var(--text-dark);
}

.forgot-link {
  color: var(--primary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 5px; /* Increase touch target */
  margin: -5px; /* Compensate for padding */
  -webkit-tap-highlight-color: transparent;
}

.forgot-link:hover,
.forgot-link:focus {
  color: var(--accent);
  text-decoration: underline;
  outline: none;
}

/* Login Button - Enhanced for Mobile */
.btn-block {
  display: block;
  width: 100%;
}

.login-btn {
  padding: 8px 0;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  min-height: 40px; /* iOS recommended touch target */
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.login-btn:hover::before {
  left: 100%;
}

.login-btn i {
  margin-left: 10px;
  transition: transform 0.2s ease;
}

.login-btn:hover i {
  transform: translateX(5px);
}

.login-btn:active {
  transform: translateY(1px);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-btn:disabled:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.login-btn:disabled i {
  transform: none;
}

/* Sign Up Link */
.signup-link {
  text-align: center;
  color: var(--text-medium);
  font-size: 0.85rem;
  margin-top: 5px;
}

.signup-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.signup-link a:hover {
  text-decoration: underline;
}

/* Footer */
.footer-light {
  border-top: 1px solid var(--border);
  padding: 15px 0;
  background: white;
  margin-top: auto;
  flex-shrink: 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5px;
}

.copyright {
  font-size: 0.85rem;
  color: var(--text-medium);
}

.tagline {
  font-size: 0.8rem;
  color: var(--text-medium);
  font-style: italic;
  margin-top: 2px !important;
}

.footer-links {
  display: flex;
  gap: 15px;
}

.footer-links a {
  color: var(--text-medium);
  font-size: 0.85rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

/* Gradient Text */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Notification Container */
#notification-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.notification {
  background-color: white;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-top: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  min-width: 280px;
  max-width: 350px;
}

.notification.show {
  transform: translateY(0);
  opacity: 1;
}

.notification.success {
  border-left: 4px solid #10B981;
}

.notification.error {
  border-left: 4px solid #EF4444;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-content i {
  font-size: 1.5rem;
}

.notification.success i {
  color: #10B981;
}

.notification.error i {
  color: #EF4444;
}

.notification-content p {
  margin: 0;
  color: #1F2937;
}

/* Enhanced Responsive Styles for Mobile-First Design */

/* Tablet and below */
@media (max-width: 991px) {
  .col-lg-6 {
    width: 100%;
    padding: 0 15px;
    margin-bottom: 30px;
  }
  
  .login-content {
    padding-right: 0;
    text-align: center;
    max-width: 600px;
    margin: 0 auto 25px;
  }
  
  .feature-item {
    justify-content: center;
    margin-bottom: 20px;
  }
  
  .login-form-container {
    max-width: 500px;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  }

  .login-page {
    padding-top: 75px;
    padding-bottom: 25px;
  }

  .welcome-badge {
    font-size: 0.85rem;
    padding: 6px 14px;
  }

  .company-slogan {
    margin-bottom: 25px;
  }

  .slogan-text {
    font-size: 1.2rem;
  }

  .login-features {
    margin-top: 25px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile landscape and smaller tablets */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .login-page {
    padding-top: 70px;
    padding-bottom: 20px;
    min-height: calc(100vh - 70px);
  }
  
  .welcome-title {
    font-size: 1.9rem;
    line-height: 1.25;
    margin-bottom: 12px;
  }

  .slogan-text {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }

  .slogan-subtitle {
    font-size: 0.95rem;
  }

  .welcome-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
  }
  
  .login-form-container {
    padding: 25px 25px;
    margin: 0 10px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  }

  .form-header {
    margin-bottom: 25px;
  }

  .form-header h2 {
    font-size: 1.4rem;
    margin-bottom: 6px;
  }

  .form-header p {
    font-size: 0.9rem;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .input-field input {
    padding: 12px 40px 12px 40px;
    height: auto;
    font-size: 1rem;
    border-radius: 12px;
    min-height: 48px; /* Touch-friendly */
  }

  .field-icon {
    font-size: 1rem;
    left: 14px;
  }

  .toggle-password {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .login-btn {
    padding: 14px 0;
    font-size: 1rem;
    border-radius: 12px;
    min-height: 52px; /* Touch-friendly */
    font-weight: 600;
  }

  .feature-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 53, 0.1);
    transition: all 0.3s ease;
  }

  .feature-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }

  .feature-icon {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }

  .feature-text h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
  }

  .feature-text p {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 10px 0;
  }
  
  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  .footer-links a {
    font-size: 0.9rem;
    padding: 5px 0;
  }

  #header {
    padding: 6px 0;
    height: 60px;
  }

  #header .container {
    padding: 0 20px;
  }

  .logo {
    font-size: 1.3rem;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .login-page {
    padding-top: 65px;
    padding-bottom: 15px;
  }

  .welcome-title {
    font-size: 1.7rem;
    line-height: 1.2;
    margin-bottom: 10px;
  }

  .slogan-text {
    font-size: 1rem;
    margin-bottom: 6px;
  }

  .slogan-subtitle {
    font-size: 0.9rem;
  }

  .welcome-description {
    font-size: 0.9rem;
    margin-bottom: 18px;
  }

  .welcome-badge {
    font-size: 0.8rem;
    padding: 5px 12px;
    margin-bottom: 15px;
  }

  .login-features {
    margin-top: 20px;
    gap: 12px;
  }

  .feature-item {
    padding: 12px;
    border-radius: 10px;
  }

  .feature-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    margin-right: 12px;
  }

  .feature-text h3 {
    font-size: 1rem;
  }

  .feature-text p {
    font-size: 0.85rem;
  }
  
  .login-form-container {
    padding: 20px 18px;
    margin: 0 5px;
    border-radius: 18px;
  }

  .form-header h2 {
    font-size: 1.3rem;
  }

  .form-header p {
    font-size: 0.85rem;
  }

  .form-group {
    margin-bottom: 16px;
  }

  label {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .input-field input {
    padding: 11px 38px 11px 38px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 10px;
    min-height: 46px;
  }

  .field-icon {
    font-size: 0.95rem;
    left: 12px;
  }

  .toggle-password {
    padding: 11px 12px;
    font-size: 0.95rem;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }

  .checkbox-label {
    font-size: 0.85rem;
  }

  .forgot-link {
    font-size: 0.85rem;
  }

  .login-btn {
    padding: 12px 0;
    font-size: 0.95rem;
    border-radius: 10px;
    min-height: 48px;
    margin-bottom: 16px;
  }

  .signup-link {
    font-size: 0.85rem;
  }

  .footer-light {
    padding: 12px 0;
  }

  .copyright {
    font-size: 0.8rem;
  }

  .tagline {
    font-size: 0.75rem;
  }

  .footer-links {
    gap: 15px;
  }

  .footer-links a {
    font-size: 0.85rem;
  }

  #header {
    height: 55px;
    padding: 4px 0;
  }

  .logo {
    font-size: 1.2rem;
  }

  /* Notification adjustments for mobile */
  #notification-container {
    bottom: 15px;
    right: 15px;
    left: 15px;
  }

  .notification {
    min-width: auto;
    max-width: none;
    width: 100%;
    padding: 0.85rem 1.2rem;
  }

  .notification-content {
    gap: 10px;
  }

  .notification-content i {
    font-size: 1.3rem;
  }

  .notification-content p {
    font-size: 0.9rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }

  .welcome-title {
    font-size: 1.5rem;
  }

  .slogan-text {
    font-size: 0.95rem;
  }

  .login-form-container {
    padding: 18px 15px;
    margin: 0 2px;
  }

  .form-header h2 {
    font-size: 1.2rem;
  }

  .input-field input {
    padding: 10px 35px 10px 35px;
    min-height: 44px;
  }

  .login-btn {
    min-height: 46px;
    font-size: 0.9rem;
  }

  .feature-item {
    padding: 10px;
  }

  .feature-icon {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
    margin-right: 10px;
  }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
  .login-page {
    padding-top: 60px;
    padding-bottom: 10px;
  }

  .welcome-title {
    font-size: 1.6rem;
    margin-bottom: 8px;
  }

  .company-slogan {
    margin-bottom: 15px;
  }

  .welcome-description {
    margin-bottom: 15px;
  }

  .login-features {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .feature-item {
    padding: 8px;
    flex-direction: column;
    text-align: center;
  }

  .feature-icon {
    margin-right: 0;
    margin-bottom: 5px;
    width: 35px;
    height: 35px;
  }

  .feature-text h3 {
    font-size: 0.9rem;
    margin-bottom: 2px;
  }

  .feature-text p {
    font-size: 0.8rem;
    display: none; /* Hide description in landscape */
  }

  .login-form-container {
    padding: 15px 20px;
  }

  .form-header {
    margin-bottom: 15px;
  }

  .form-group {
    margin-bottom: 12px;
  }
}

/* Animation for features */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-item {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Loading animation for button */
.login-btn.loading {
  opacity: 0.8;
  cursor: not-allowed;
}

/* Input validation states */
.input-valid input {
  border-color: var(--success);
}

.input-invalid input {
  border-color: var(--danger);
}

.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
