/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

/* ===== FONT AWESOME LOADED LOCALLY ===== */
/* Font Awesome styles are now in fonts/fontawesome-local.css */

/* CSS Variables - Based on Mapuo_exchange styles */
:root {
  /* Colors from reference project */
  --primary-blue: #1e40af;
  --secondary-blue: #3b82f6;
  --light-blue: #dbeafe;
  --dark-blue: #1e3a8a;
  --background-light: #f8fafc;
  --background-white: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --hover-bg: #f1f5f9;
  --active-bg: #dbeafe;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  
  /* Typography mixins from reference */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Monaco', 'Cascadia Code', monospace;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --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);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--background-light);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== LANGUAGE SELECTOR ===== */
.language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.lang-dropdown {
  position: relative;
}

.lang-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-button:hover {
  background: rgba(255, 255, 255, 1);
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.flag-icon {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
}

.lang-button i {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.lang-dropdown.active .lang-button i {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1001;
}

.lang-dropdown.active .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.lang-option:hover {
  background: var(--background-light);
  color: var(--primary-blue);
}

.lang-option:first-child {
  border-radius: 7px 7px 0 0;
}

.lang-option:last-child {
  border-radius: 0 0 7px 7px;
}

.lang-option.active {
  background: var(--primary-blue);
  color: white;
}

/* Login Container */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
}

/* Background Pattern */
.background-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    transparent 30%, 
    rgba(255, 255, 255, 0.05) 70%, 
    transparent 100%);
  pointer-events: none;
}

/* Login Form Wrapper */
.login-form-wrapper {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

/* Login Form - Based on portfolioSection styles */
.login-form {
  background: var(--background-white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}


/* Logo Section */
.logo-section {
  text-align: center;
  margin-bottom: 24px;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.main-logo {
  width: 142px;
  height: 142px;
  object-fit: contain;
  flex-shrink: 0;
  transition: all 0.2s ease;
  border-radius: 12px;
  margin: -50px 0;
}


.brand-text {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-blue);
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(59, 130, 246, 0.1);
}

.welcome-text {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0 0 8px 0;
  font-family: var(--font-body);
}

/* Form Styles - Based on toggleSwitch styles */
.broker-form,
.password-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-label i {
  color: var(--primary-blue);
  font-size: 16px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  height: 56px;
  padding: 16px 20px 16px 50px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  font-family: var(--font-mono);
  background: var(--background-white);
  color: var(--text-primary);
  transition: all 0.2s ease;
  outline: none;
  letter-spacing: 0.5px;
}

.form-input:focus {
  border: 2px solid var(--primary-blue);
  box-shadow: none;
  background: var(--background-white);
  outline: none !important;
}

.form-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-body);
  letter-spacing: 0;
}

.input-icon {
  position: absolute;
  left: 18px;
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-input:focus + .input-icon {
  color: var(--primary-blue);
}

.input-help {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-body);
  margin-top: 4px;
}

/* Login Button - Based on withdrawButton styles */
.login-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 32px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  min-height: 56px;
}

.login-button:hover:not(:disabled) {
  background: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.login-button:active:not(:disabled) {
  transform: translateY(0);
}

.login-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.login-button.loading {
  background: var(--secondary-blue);
  cursor: wait;
}

.login-button.loading:hover {
  background: var(--secondary-blue);
  transform: none;
}

.button-text {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button-loader {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Additional Info */
.additional-info {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

.info-item i {
  color: var(--success-color);
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* Security Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  z-index: 5000;
  animation: fadeIn 0.3s ease-in-out;
}

.modal-container {
  width: 480px;
  max-width: 90%;
  background: var(--background-white);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: slideUp 0.4s ease-out;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
  padding: 24px 24px 20px 24px;
  text-align: center;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.5s ease;
}

.modal-header.error {
  background: linear-gradient(135deg, #fecaca, #fca5a5);
}

.security-icon {
  margin: 0 auto 12px auto;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 50%;
  color: white;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  transition: all 0.5s ease;
}

.security-icon.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
  font-family: var(--font-body);
}

.modal-content {
  padding: 20px 24px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Security Check Items */
.security-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--background-light);
  border-radius: 10px;
  border: 1px solid var(--border-light);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  transform: translateY(20px);
  margin-bottom: 12px;
}

.check-item:first-child {
  opacity: 1;
  transform: translateY(0);
}

.check-item:not(:first-child) {
  display: none;
}

.check-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.check-item.checking {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
}

.check-item.success {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #22c55e;
}

.check-item.error {
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  border-color: #ef4444;
}

.check-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-white);
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.check-item.checking .check-icon {
  border-color: #f59e0b;
  background: #fef3c7;
}

.check-item.success .check-icon {
  border-color: #22c55e;
  background: #f0fdf4;
}

.check-item.error .check-icon {
  border-color: #ef4444;
  background: #fef2f2;
}

.check-icon i {
  font-size: 14px;
  color: var(--text-secondary);
}

.check-item.checking .check-icon i {
  color: #f59e0b;
}

.check-item.success .check-icon i {
  color: #22c55e;
}

.check-item.error .check-icon i {
  color: #ef4444;
}

.check-content {
  flex: 1;
}

.check-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.check-details {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.check-status {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-status .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-top: 2px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.check-status i {
  font-size: 14px;
}

.check-status .fa-check {
  color: #22c55e;
}

.check-status .fa-times {
  color: #ef4444;
}

/* Error Summary */
.error-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #fef2f2, #fecaca);
  border: 1px solid #ef4444;
  border-radius: 10px;
  margin-bottom: 16px;
}

.error-icon {
  width: 36px;
  height: 36px;
  background: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.error-icon i {
  font-size: 16px;
  color: white;
}

.error-content h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #dc2626;
  margin: 0 0 2px;
}

.error-content p {
  font-family: var(--font-body);
  font-size: 12px;
  color: #991b1b;
  margin: 0;
  line-height: 1.3;
}

.modal-footer {
  padding: 0 24px;
  border-top: 1px solid var(--border-color);
  background: var(--background-light);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  transform: translateY(30px);
  max-height: 0;
  overflow: hidden;
}

.modal-footer.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 300px;
  padding: 20px 24px;
}

.modal-button {
  width: 100%;
  padding: 12px 20px;
  background: var(--success-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.modal-button:hover {
  background: #0d9488;
  transform: translateY(-1px);
}

.error-button {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.error-button:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}

/* Toast Styles */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--background-white);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 6000;
  animation: slideInRight 0.3s ease-out;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-toast {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.toast-content i {
  font-size: 18px;
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Responsive Design */
/* ===== MOBILE RESPONSIVE DESIGN ===== */

/* Mobile First - Base styles for mobile devices */
@media (max-width: 480px) {
  /* Language Selector Mobile */
  .language-selector {
    top: 15px;
    right: 15px;
  }
  
  .lang-button {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    gap: 6px;
  }
  
  .flag-icon {
    width: 16px;
    height: 12px;
  }
  
  .lang-menu {
    min-width: 120px;
    right: 0;
    max-height: 60vh;
    overflow-y: auto;
  }
  
  .lang-option {
    padding: 8px 10px;
    font-size: 12px;
    gap: 8px;
  }
  
  /* Main Container Mobile */
  .login-container {
    padding: 10px;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
  }
  
  .login-form-wrapper {
    width: 100%;
    padding: 0;
  }
  
  .login-form {
    padding: 20px 16px;
    margin: 0;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    min-height: auto;
  }
  
  /* Logo Mobile */
  .logo-section {
    margin-bottom: 20px;
  }
  
  .main-logo {
    width: 140px;
    height: 140px;
  }
  
  .welcome-text {
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.4;
    text-align: center;
  }
  
  /* Form Elements Mobile */
  .input-group {
    margin-bottom: 16px;
  }
  
  .input-label {
    font-size: 14px;
    margin-bottom: 6px;
  }
  
  .form-input {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 10px;
    min-height: 48px; /* Touch target */
    box-sizing: border-box;
  }
  
  .input-help {
    font-size: 11px;
    margin-top: 4px;
  }
  
  /* Buttons Mobile */
  .login-button, .back-button {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 48px;
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .button-text {
    gap: 8px;
  }
  
  /* Broker Info Mobile */
  .broker-details {
    gap: 12px;
  }
  
  .detail-item {
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .detail-label {
    font-size: 12px;
    gap: 4px;
    flex: 0 0 auto;
  }
  
  .detail-value {
    font-size: 13px;
    text-align: right;
    flex: 1 1 auto;
  }
  
  /* Additional Info Mobile */
  .additional-info {
    margin-top: 16px;
  }
  
  .info-item {
    font-size: 11px;
    gap: 6px;
  }
  
  /* Password Form Mobile */
  .password-form {
    gap: 16px;
  }
  
  /* Mobile Security Modal */
  .modal-overlay {
    padding: 10px;
    align-items: center;
    justify-content: center;
  }
  
  .modal-container {
    width: 95%;
    max-width: 400px;
    margin: 0;
    border-radius: 16px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .modal-overlay.active .modal-container {
    transform: scale(1);
    opacity: 1;
  }
  
  .modal-header {
    padding: 16px 20px 12px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  .security-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-bottom: 8px;
  }
  
  .modal-title {
    font-size: 18px;
    margin-bottom: 4px;
  }
  
  .modal-subtitle {
    font-size: 13px;
  }
  
  .modal-content {
    padding: 16px 20px 20px 20px;
  }
  
  .security-checks {
    gap: 8px;
    margin-top: 0;
  }
  
  .check-item {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
  }
  
  .check-item:first-child {
    margin-top: 8px;
  }
  
  .check-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  
  .check-icon i {
    font-size: 12px;
  }
  
  .check-content {
    flex: 1;
    min-width: 0;
  }
  
  .check-title {
    font-size: 13px;
    margin-bottom: 2px;
    line-height: 1.3;
  }
  
  .check-details {
    font-size: 11px;
    line-height: 1.3;
  }
  
  .check-status {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }
  
  .check-status .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }
  
  .check-status i {
    font-size: 11px;
  }
  
  /* Error Summary Mobile */
  .error-summary {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
  }
  
  .error-icon {
    width: 32px;
    height: 32px;
  }
  
  .error-icon i {
    font-size: 14px;
  }
  
  .error-content h3 {
    font-size: 14px;
    margin-bottom: 4px;
  }
  
  .error-content p {
    font-size: 12px;
  }
  
  /* Modal Footer Mobile */
  .modal-footer {
    padding: 12px 20px 20px 20px;
    position: sticky;
    bottom: 0;
    background: var(--background-white);
    border-top: 1px solid var(--border-color);
  }
  
  .modal-button {
    padding: 12px 20px;
    font-size: 15px;
    border-radius: 10px;
    width: 100%;
    min-height: 48px;
  }
}

/* Tablet Portrait */
@media (min-width: 481px) and (max-width: 768px) {
  .language-selector {
    top: 20px;
    right: 20px;
  }
  
  .login-container {
    padding: 20px;
    padding-top: 80px;
  }
  
  .login-form {
    padding: 30px 24px;
    border-radius: 16px;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .main-logo {
    width: 130px;
    height: 130px;
  }
  
  .welcome-text {
    font-size: 15px;
    margin-bottom: 25px;
  }
  
  .form-input {
    padding: 15px 18px;
    font-size: 16px;
    border-radius: 12px;
  }
  
  .login-button, .back-button {
    padding: 15px 22px;
    font-size: 16px;
    border-radius: 12px;
  }
  
  /* Tablet Security Modal */
  .modal-container {
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
  }
  
  .modal-header {
    padding: 20px 24px 16px 24px;
  }
  
  .modal-content {
    padding: 0 24px 24px 24px;
  }
  
  .check-item {
    padding: 14px 16px;
  }
  
  .check-title {
    font-size: 14px;
  }
  
  .check-details {
    font-size: 12px;
  }
}

/* Desktop */
@media (min-width: 769px) {
  .login-container {
    padding: 40px;
  }
  
  .login-form {
    max-width: 420px;
    padding: 40px;
  }
  
  /* Desktop Security Modal - center properly */
  .modal-overlay {
    align-items: center;
    justify-content: center;
  }
  
  .modal-container {
    margin: 0 auto;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .modal-overlay.active .modal-container {
    transform: scale(1);
    opacity: 1;
  }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .lang-button:hover,
  .lang-option:hover,
  .login-button:hover,
  .back-button:hover,
  .modal-button:hover {
    transform: none;
    box-shadow: none;
  }
  
  /* Add active states for touch */
  .lang-button:active,
  .login-button:active,
  .back-button:active,
  .modal-button:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  .lang-option:active {
    background: var(--primary-blue);
    color: white;
  }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .login-container {
    padding-top: 20px;
    align-items: center;
  }
  
  .main-logo {
    width: 60px;
    height: 60px;
  }
  
  .welcome-text {
    font-size: 13px;
    margin-bottom: 15px;
  }
  
  .logo-section {
    margin-bottom: 15px;
  }
  
  .modal-container {
    max-height: 90vh;
  }
}

/* Very Small Screens */
@media (max-width: 320px) {
  .login-form {
    padding: 16px 12px;
  }
  
  .main-logo {
    width: 120px;
    height: 120px;
  }
  
  .welcome-text {
    font-size: 13px;
  }
  
  .form-input {
    padding: 12px 14px;
    font-size: 16px;
  }
  
  .login-button, .back-button {
    padding: 12px 16px;
    font-size: 15px;
  }
  
  .lang-button {
    padding: 5px 8px;
    font-size: 11px;
  }
  
  .lang-menu {
    min-width: 110px;
  }
  
  .lang-option {
    padding: 7px 8px;
    font-size: 11px;
  }
}
  
  .brand-text {
    font-size: 22px;
  }
  
  .form-input {
    padding: 12px 14px 12px 42px;
    font-size: 14px;
  }
  
  .input-icon {
    left: 16px;
    font-size: 16px;
  }
}

/* Focus and Accessibility */
.form-input:focus,
.login-button:focus,
.modal-button:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-muted: #333333;
  }
}

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

/* Single Form Transformation Styles */
.form-content {
  position: relative;
  min-height: 200px;
  overflow: hidden;
}

.step-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
}

.step-content:first-child {
  position: relative;
}

.step-content.slide-out-left {
  transform: translateX(-100%);
}

.step-content.slide-out-right {
  transform: translateX(100%);
}

.step-content.slide-in-left {
  transform: translateX(-100%);
}

.step-content.slide-in-right {
  transform: translateX(100%);
}

.step-content.slide-in-left.active,
.step-content.slide-in-right.active {
  transform: translateX(0);
}

/* Content height animation */
.form-content.transitioning {
  transition: min-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Broker Info Styles */
.license-status {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.status-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.status-header i {
  color: var(--success-color);
  font-size: 20px;
}

.status-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--success-color);
  margin: 0;
}

.broker-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.broker-details .detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--background-white);
  border-radius: 6px;
  border: 1px solid rgba(187, 247, 208, 0.5);
}

.broker-details .detail-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 6px;
}

.broker-details .detail-label i {
  font-size: 12px;
  color: var(--success-color);
  width: 14px;
  text-align: center;
}

.broker-details .detail-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
  text-align: right;
  margin-left: auto;
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.password-toggle:hover {
  color: var(--text-secondary);
  background: var(--hover-bg);
}

/* Back Button */
.back-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
  min-height: 44px;
}

.back-button:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.back-button i {
  font-size: 14px;
}

/* Loading Animation for License Input Field */
.checking-license .form-input {
  position: relative;
  animation: shimmerPulse 1.5s infinite;
}

.checking-license .form-input::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(59, 130, 246, 0.3), 
    rgba(255, 255, 255, 0.5),
    rgba(59, 130, 246, 0.3),
    transparent
  );
  border-radius: 12px;
  animation: shimmer 1.5s infinite;
  pointer-events: none;
  z-index: 10;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes shimmerPulse {
  0%, 100% { 
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  }
  50% { 
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4);
  }
}

/* Responsive adjustments for new elements */
@media (max-width: 768px) {
  .license-status {
    padding: 16px;
  }
  
  .status-header h3 {
    font-size: 16px;
  }
  
  .broker-details .detail-item {
    padding: 6px 10px;
  }
  
  .broker-details .detail-label,
  .broker-details .detail-value {
    font-size: 13px;
  }
  
  .back-button {
    padding: 10px 16px;
    font-size: 13px;
  }
}
