/* ============================================
   MODERN LOGIN PAGE - 2026 DESIGN PATTERNS
   ============================================ */

/* ===== RESET & GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Modern Color Palette 2026 */
  --primary-gradient: linear-gradient(
    135deg,
    #6366f1 0%,
    #8b5cf6 50%,
    #d946ef 100%
  );
  --secondary-gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --dark-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);

  /* Colors */
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #d946ef;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.16);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
  height: 100%;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Safe Area Insets for Notched Devices */
body {
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

/* Prevent iOS bounce scroll */
body {
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

.hidden {
  display: none;
}

/* ===== MAIN CONTAINER ===== */
.login-container {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--bg-light);
}

.login-container .row {
  margin: 0;
  min-height: 100vh;
}

/* ===== ANIMATED BACKGROUND ===== */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  opacity: 0;
  animation: layerFade 12s ease-in-out infinite;
}

.layer-1 {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  animation-delay: 0s;
}

.layer-2 {
  background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
  animation-delay: 4s;
}

.layer-3 {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  animation-delay: 8s;
}

@keyframes layerFade {
  0%,
  33.33% {
    opacity: 1;
  }
  33.34%,
  100% {
    opacity: 0;
  }
}

/* Floating Shapes */
.floating-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  animation: float 20s infinite ease-in-out;
}

.shape-1 {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  top: 60%;
  left: 80%;
  animation-delay: 2s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  top: 80%;
  left: 20%;
  animation-delay: 4s;
}

.shape-4 {
  width: 250px;
  height: 250px;
  top: 30%;
  left: 70%;
  animation-delay: 1s;
}

.shape-5 {
  width: 180px;
  height: 180px;
  top: 50%;
  left: 40%;
  animation-delay: 3s;
}

.shape-6 {
  width: 220px;
  height: 220px;
  top: 20%;
  right: 15%;
  animation-delay: 5s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(30px, -30px) rotate(90deg);
  }
  50% {
    transform: translate(-20px, 20px) rotate(180deg);
  }
  75% {
    transform: translate(40px, 10px) rotate(270deg);
  }
}

/* ===== LEFT INFO PANEL ===== */
.info-panel {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  position: relative;
  z-index: 1;
}

.info-content {
  max-width: 500px;
  color: white;
  animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Brand Section */
.brand-section {
  margin-bottom: var(--spacing-xl);
  text-align: center;
}

.brand-icon-wrapper {
  margin-bottom: var(--spacing-md);
  animation: bounceIn 1s ease-out;
}

.brand-icon-wrapper i {
  font-size: 80px;
  color: white;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.brand-name {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: var(--spacing-xs);
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.5px;
}

.brand-tagline {
  font-size: 1.125rem;
  font-weight: 400;
  opacity: 0.95;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Features List */
.features-list {
  margin-bottom: var(--spacing-xl);
}

.feature-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition-base);
  animation: fadeInUp 0.6s ease-out both;
}

.feature-item:nth-child(1) {
  animation-delay: 0.2s;
}
.feature-item:nth-child(2) {
  animation-delay: 0.4s;
}
.feature-item:nth-child(3) {
  animation-delay: 0.6s;
}

.feature-item:hover {
  transform: translateX(10px);
  background: rgba(255, 255, 255, 0.15);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--spacing-md);
}

.feature-icon i {
  font-size: 24px;
}

.feature-text h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.feature-text p {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
}

/* Stats Section */
.stats-section {
  display: flex;
  justify-content: space-around;
  padding: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  background: white;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
}

/* ===== RIGHT LOGIN PANEL ===== */
.login-panel {
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.login-wrapper {
  width: 100%;
  max-width: 480px;
  animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile Brand */
.mobile-brand {
  margin-bottom: var(--spacing-lg);
}

.mobile-icon {
  margin-bottom: var(--spacing-sm);
}

.mobile-icon i {
  font-size: 48px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mobile-brand h2 {
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

/* Card Header */
.card-header-section {
  margin-bottom: var(--spacing-lg);
}

.login-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ===== MODERN FORM STYLES ===== */
.modern-form {
  width: 100%;
}

/* Form Group */
.form-group-modern {
  margin-bottom: var(--spacing-lg);
}

/* Input Wrapper */
.input-wrapper {
  position: relative;
  transition: all var(--transition-base);
}

/* Input Icon */
.input-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: all var(--transition-base);
  z-index: 2;
}

.input-wrapper.focused .input-icon,
.input-wrapper.typing .input-icon {
  color: var(--primary-color);
}

.input-icon i {
  font-size: 20px;
}

/* Form Input */
.form-input {
  width: 100%;
  height: 56px;
  padding: 0 48px;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  outline: none;
  position: relative;
  z-index: 1;
}

.form-input:focus {
  background: var(--bg-white);
  border-color: var(--primary-color);
}

/* Floating Label */
.floating-label {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-secondary);
  pointer-events: none;
  transition: all var(--transition-base);
  z-index: 2;
  background: transparent;
  padding: 0 4px;
}

.input-wrapper.focused .floating-label,
.form-input:not(:placeholder-shown) ~ .floating-label {
  top: -10px;
  left: 44px;
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 600;
  background: var(--bg-white);
}

/* Input Border Animation */
.input-border {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width var(--transition-base);
  border-radius: var(--radius-full);
}

.input-wrapper.focused .input-border {
  width: 100%;
}

/* Toggle Password */
.toggle-password {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: 2;
  border-radius: var(--radius-md);
}

.toggle-password:hover {
  color: var(--primary-color);
  background: var(--bg-light);
}

.toggle-password i {
  font-size: 20px;
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Form Options */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
}

/* Custom Checkbox */
.custom-checkbox-wrapper {
  display: flex;
  align-items: center;
}

.custom-checkbox-input {
  display: none;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.checkbox-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-right: var(--spacing-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  position: relative;
}

.checkbox-box::after {
  content: "\F012C";
  font-family: "Material Design Icons";
  font-size: 14px;
  color: white;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-base);
}

.custom-checkbox-input:checked ~ .custom-checkbox-label .checkbox-box {
  background: var(--primary-gradient);
  border-color: var(--primary-color);
}

.custom-checkbox-input:checked ~ .custom-checkbox-label .checkbox-box::after {
  opacity: 1;
  transform: scale(1);
}

.checkbox-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Forgot Link */
.forgot-link {
  font-size: 0.875rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-base);
  position: relative;
}

.forgot-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width var(--transition-base);
}

.forgot-link:hover {
  color: var(--secondary-color);
}

.forgot-link:hover::after {
  width: 100%;
}

/* ===== SUBMIT BUTTON ===== */
.submit-btn {
  width: 100%;
  height: 56px;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--spacing-md);
}

.submit-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.submit-btn:hover::before {
  width: 300px;
  height: 300px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

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

.btn-text {
  display: flex;
  align-items: center;
  transition: all var(--transition-base);
}

.btn-icon {
  margin-left: var(--spacing-xs);
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateX(-10px);
  transition: all var(--transition-base);
}

.submit-btn:hover .btn-icon {
  opacity: 1;
  transform: translateX(0);
}

.btn-loader {
  display: none;
}

.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon {
  display: none;
}

.submit-btn.loading .btn-loader {
  display: block;
}

/* Security Badge */
.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: var(--spacing-sm);
}

.security-badge i {
  margin-right: 4px;
  color: #10b981;
}

/* ===== FOOTER ===== */
.login-footer {
  text-align: center;
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
}

.copyright {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.powered {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin: 0;
}

.powered i {
  color: #ef4444;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  10%,
  30% {
    transform: scale(0.9);
  }
  20%,
  40% {
    transform: scale(1.1);
  }
}

/* ===== PRELOADER ===== */
#preloader {
  background: var(--bg-white) !important;
}

#status {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bg-light);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large Tablets & Below (iPad Pro) */
@media (max-width: 1199.98px) {
  .brand-name {
    font-size: 2.5rem;
  }

  .feature-item {
    padding: var(--spacing-sm);
  }

  .stats-section {
    padding: var(--spacing-md);
  }
}

/* Tablets & Below (iPad) */
@media (max-width: 991.98px) {
  /* Hide desktop info panel, show full-screen login */
  .login-container {
    background: var(--primary-gradient);
  }

  .login-panel {
    background: transparent;
    padding: var(--spacing-lg);
  }

  .glass-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
  }

  .login-footer .copyright {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
  }

  .login-footer .powered {
    color: rgba(255, 255, 255, 0.9);
  }

  /* Add more spacing for touch targets */
  .form-group-modern {
    margin-bottom: var(--spacing-xl);
  }
}

/* Mobile Landscape & Below */
@media (max-width: 767.98px) {
  :root {
    --spacing-xl: 2rem;
    --spacing-lg: 1.5rem;
    --spacing-md: 1rem;
  }

  .login-wrapper {
    max-width: 100%;
    width: 100%;
  }

  .glass-card {
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
  }

  .login-title {
    font-size: 1.75rem;
  }

  .login-subtitle {
    font-size: 0.9375rem;
  }

  /* Optimize form inputs for mobile */
  .form-input {
    height: 54px;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0 50px;
  }

  .floating-label {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .input-wrapper.focused .floating-label,
  .form-input:not(:placeholder-shown) ~ .floating-label {
    font-size: 0.75rem;
  }

  .submit-btn {
    height: 54px;
    font-size: 1rem;
  }

  /* Mobile brand adjustments */
  .mobile-brand {
    margin-bottom: var(--spacing-md);
  }

  .mobile-brand h2 {
    font-size: 1.5rem;
  }

  /* Ensure floating shapes don't interfere on mobile */
  .shape {
    opacity: 0.5;
  }
}

/* Small Mobile Devices */
@media (max-width: 575.98px) {
  :root {
    --spacing-xl: 1.5rem;
    --spacing-lg: 1rem;
    --spacing-md: 0.75rem;
  }

  .login-panel {
    padding: var(--spacing-md);
    min-height: 100vh;
    display: flex;
    align-items: center;
  }

  .login-wrapper {
    padding: 0;
  }

  .glass-card {
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  }

  .card-header-section {
    margin-bottom: var(--spacing-md);
  }

  .login-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .login-subtitle {
    font-size: 0.875rem;
  }

  /* Stack form options vertically */
  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
  }

  .forgot-link {
    margin-top: var(--spacing-xs);
  }

  /* Optimize inputs for small screens */
  .form-input {
    height: 50px;
    padding: 0 48px;
  }

  .input-icon {
    width: 44px;
    height: 44px;
  }

  .toggle-password {
    width: 44px;
    height: 44px;
  }

  .submit-btn {
    height: 50px;
    font-size: 0.9375rem;
  }

  /* Mobile brand smaller */
  .mobile-icon i {
    font-size: 40px;
  }

  .mobile-brand h2 {
    font-size: 1.375rem;
  }

  /* Security badge smaller text */
  .security-badge {
    font-size: 0.6875rem;
  }

  /* Footer adjustments */
  .login-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
  }

  .copyright {
    font-size: 0.8125rem;
  }

  .powered {
    font-size: 0.75rem;
  }

  /* Reduce animation complexity on mobile */
  .shape {
    opacity: 0.3;
    animation-duration: 30s;
  }
}

/* Extra Small Devices (< 400px) */
@media (max-width: 399.98px) {
  .glass-card {
    padding: var(--spacing-md);
  }

  .login-title {
    font-size: 1.375rem;
  }

  .form-input,
  .submit-btn {
    height: 48px;
    font-size: 0.875rem;
  }

  .input-icon,
  .toggle-password {
    width: 40px;
    height: 40px;
  }

  .input-icon i,
  .toggle-password i {
    font-size: 18px;
  }

  .form-group-modern {
    margin-bottom: var(--spacing-md);
  }
}

/* Landscape Mobile Orientation */
@media (max-height: 600px) and (orientation: landscape) {
  .login-panel {
    padding: var(--spacing-sm);
  }

  .glass-card {
    padding: var(--spacing-md);
  }

  .card-header-section {
    margin-bottom: var(--spacing-sm);
  }

  .login-title {
    font-size: 1.375rem;
  }

  .login-subtitle {
    display: none; /* Hide subtitle in landscape to save space */
  }

  .form-group-modern {
    margin-bottom: var(--spacing-md);
  }

  .form-input,
  .submit-btn {
    height: 46px;
  }

  .mobile-brand {
    margin-bottom: var(--spacing-sm);
  }

  .mobile-icon {
    display: none; /* Hide icon in landscape */
  }

  .security-badge {
    display: none; /* Hide security badge in landscape */
  }

  .login-footer {
    margin-top: var(--spacing-sm);
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch target sizes */
  .form-input {
    min-height: 48px;
  }

  .submit-btn {
    min-height: 48px;
  }

  .toggle-password,
  .custom-checkbox-label {
    min-width: 44px;
    min-height: 44px;
  }

  /* Disable hover effects on touch devices */
  .feature-item:hover,
  .submit-btn:hover,
  .glass-card:hover {
    transform: none;
  }

  /* Increase checkbox touch area */
  .checkbox-box {
    width: 24px;
    height: 24px;
  }
}

/* High DPI Displays (Retina) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .glass-card {
    backdrop-filter: blur(25px);
  }

  .shape {
    backdrop-filter: blur(25px);
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .glass-card {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .login-title {
    color: var(--bg-white);
  }

  .login-subtitle {
    color: var(--text-light);
  }

  .form-input {
    background: rgba(15, 23, 42, 0.5);
    color: var(--bg-white);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .form-input:focus {
    background: rgba(15, 23, 42, 0.7);
  }

  .floating-label {
    color: var(--text-light);
  }

  .copyright,
  .powered {
    color: var(--text-light);
  }

  .checkbox-text {
    color: var(--text-light);
  }
}

/* ===== ACCESSIBILITY ===== */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* ===== MOBILE-SPECIFIC UTILITIES ===== */

/* Virtual Keyboard Open State */
body.keyboard-open {
  height: 100vh;
  overflow: hidden;
}

body.keyboard-open .login-panel {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.keyboard-open .login-footer {
  display: none;
}

body.keyboard-open .glass-card {
  margin-bottom: 20vh;
}

/* Touch Feedback */
.submit-btn.active-touch {
  transform: scale(0.98);
  opacity: 0.9;
}

/* Prevent Text Selection on Mobile */
@media (hover: none) {
  .submit-btn,
  .toggle-password,
  .forgot-link,
  .custom-checkbox-label {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
}

/* iOS Safari Specific Fixes */
@supports (-webkit-touch-callout: none) {
  /* Fix for iOS Safari bottom bar */
  .login-container {
    min-height: -webkit-fill-available;
  }

  .login-panel {
    min-height: -webkit-fill-available;
  }

  /* Prevent iOS zoom on focus */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Android Chrome Specific */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
  .form-input {
    -webkit-text-size-adjust: 100%;
  }
}

/* Prevent Horizontal Scroll on Mobile */
.login-container,
.login-panel,
.login-wrapper,
.glass-card {
  max-width: 100vw;
  overflow-x: hidden;
}
