* {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

html, body {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  word-break: break-word;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  display: flex;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  word-break: break-word;
}

.login-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  align-items: center;
}

.login-branding {
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 20px;
  width: 100%;
  min-height: 40vh;
}

.brand-content {
  text-align: center;
  max-width: 400px;
}

.brand-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.login-branding h1 {
  font-size: 48px;
  margin-bottom: 10px;
  font-weight: 700;
}

.login-branding p {
  font-size: 16px;
  opacity: 0.8;
  margin-bottom: 40px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  opacity: 0.9;
}

.feature i {
  font-size: 18px;
}

.login-form-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  width: 100%;
  min-height: auto;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
}

h2 {
  text-align: center;
  margin: 0 0 24px 0;
  color: #e0f2fe;
  font-size: 28px;
  font-weight: 700;
}

.form-group {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  display: block;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #e0f2fe;
}

input {
  width: 100%;
  max-width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid rgba(59, 130, 246, 0.2);
  font-size: 15px;
  transition: all 0.3s ease;
  background: rgba(30, 41, 59, 0.5);
  color: #e0f2fe;
  box-sizing: border-box;
}

input::placeholder {
  color: #64748b;
}

input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: rgba(30, 41, 59, 0.8);
}

.password-wrapper,
.password-input-group {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 12px;
}

.password-wrapper input,
.password-input-group input {
  padding-right: 48px;
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  display: block;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.3s;
  color: #38bdf8;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  z-index: 10;
}

.toggle-password:hover {
  color: #06b6d4;
}

.error {
  color: #ff6b6b;
  font-size: 13px;
  margin: 0;
  display: none;
}

button {
  width: 100%;
  max-width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  box-sizing: border-box;
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

button:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e40af, #1a34a8);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fa-spin {
  animation: spin 1s linear infinite;
}

.switch {
  text-align: center;
  margin-top: 16px;
}

.switch p {
  margin: 0;
  color: #6b7280;
  font-size: 15px;
}

.switch a {
  color: #2563eb;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s ease;
  margin-left: 4px;
}

.switch a:hover {
  color: #1e40af;
  text-decoration: underline;
}

.admin-login-link {
  margin-top: 8px !important;
  font-size: 12px !important;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.admin-login-link:hover {
  opacity: 0.9;
}

.admin-login-link a {
  color: #9ca3af !important;
  font-size: 12px;
  font-weight: 500 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  text-decoration: none !important;
}

.admin-login-link a:hover {
  color: #6b7280 !important;
  background: rgba(0, 0, 0, 0.02);
  text-decoration: none !important;
}

.mode-switch {
  margin-bottom: 12px;
}

.mode-btn {
  width: 100%;
  padding: 12px;
  background: #f3f4f6;
  color: #1f2937;
  border: 2px solid #e5e7eb;
  font-size: 14px;
  margin: 0;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  background: #e5e7eb;
  border-color: #2563eb;
  transform: none;
  box-shadow: none;
}

/* ADMIN SECTION */
.admin-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid #e0e0e0;
  text-align: center;
}

.admin-text {
  color: #666;
  font-size: 14px;
  margin-bottom: 15px;
  font-weight: 500;
}

.admin-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.admin-toggle-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

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

.admin-toggle-btn i {
  font-size: 16px;
}

.admin-form {
  margin-top: 20px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.admin-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-btn:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6b4193 100%);
}

@media (max-width: 1024px) {
  .login-wrapper {
    flex-direction: column;
  }

  .login-branding {
    min-height: 40vh;
    padding: 30px 20px;
  }

  .login-form-container {
    padding: 30px 20px;
  }

  .login-branding h1 {
    font-size: 36px;
  }

  .brand-icon {
    font-size: 60px;
  }
}

@media (max-width: 768px) {
  .login-wrapper {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .login-branding {
    min-height: 35vh;
    padding: 24px 16px;
  }

  .login-form-container {
    padding: 24px 16px;
    min-height: auto;
  }

  .login-branding h1 {
    font-size: 28px;
  }

  .login-branding p {
    font-size: 14px;
  }

  .brand-icon {
    font-size: 56px;
    margin-bottom: 15px;
  }

  .brand-features {
    gap: 12px;
    margin-top: 20px;
  }

  .feature {
    font-size: 13px;
    gap: 10px;
  }

  .feature i {
    font-size: 16px;
  }

  h2 {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .form {
    gap: 14px;
  }

  label {
    font-size: 14px;
  }

  input {
    padding: 11px;
    font-size: 16px;
  }

  button {
    padding: 11px;
    font-size: 15px;
  }

  .toggle-password {
    font-size: 13px;
  }

  .admin-section {
    margin-top: 24px;
    padding-top: 20px;
  }

  .admin-toggle-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .admin-form {
    margin-top: 16px;
    padding: 16px;
  }

  .admin-form h2 {
    font-size: 18px;
  }

  .live-chat-widget {
    width: calc(100% - 16px);
    height: 50vh;
    max-height: 70vh;
    bottom: 80px;
    right: 8px;
    left: 8px;
  }

  .chat-toggle-btn {
    bottom: 20px;
    right: 16px;
    width: 54px;
    height: 54px;
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .message-content {
    max-width: 95%;
    padding: 8px 10px;
    font-size: 12px;
  }

  .message-content p {
    font-size: 12px;
    line-height: 1.3;
  }

  .chat-messages {
    padding: 8px 4px;
    gap: 8px;
  }

  .chat-input {
    font-size: 12px;
    padding: 7px 12px;
  }

  .chat-input-area {
    padding: 6px 4px;
    gap: 3px;
  }

  .login-wrapper {
    flex-direction: column;
    height: auto;
  }

  .login-branding {
    min-height: 25vh;
    padding: 12px;
  }

  .login-form-container {
    min-height: auto;
    padding: 12px;
  }

  h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .form {
    gap: 10px;
    width: 100%;
  }

  label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  input {
    padding: 10px;
    font-size: 16px;
  }

  button {
    padding: 10px;
    font-size: 13px;
  }

  .brand-icon {
    font-size: 40px;
    margin-bottom: 8px;
  }

  .login-branding h1 {
    font-size: 22px;
  }

  .login-branding p {
    font-size: 12px;
  }

  .brand-features {
    gap: 8px;
  }

  .feature {
    font-size: 11px;
  }

  .mode-switch {
    margin-bottom: 8px;
  }

  .mode-btn {
    padding: 8px;
    font-size: 12px;
  }

  .live-chat-widget {
    width: calc(100% - 12px);
    height: 55vh;
    bottom: 60px;
    right: 6px;
    left: 6px;
  }

  .chat-toggle-btn {
    bottom: 12px;
    right: 10px;
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}

/* Live Chat Widget */
.chat-toggle-btn {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 56px !important;
  height: 56px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #4f46e5, #22c55e) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4) !important;
  cursor: pointer !important;
  font-size: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-width: auto !important;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.6);
}

.chat-toggle-btn:active {
  transform: scale(0.95);
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  border: 2px solid white;
}

.live-chat-widget {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  z-index: 998;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(20px);
}

.live-chat-widget.active {
  display: flex !important;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

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

.chat-header {
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  transition: transform 0.2s;
}

.chat-close-btn:hover {
  transform: scale(1.1);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9fafb;
}

.chat-message {
  display: flex;
  gap: 8px;
  animation: fadeIn 0.3s ease-in-out;
}

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

.chat-message.user-message {
  justify-content: flex-end;
}

.message-content {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.bot-message .message-content {
  background: #e5e7eb;
  color: #1f2937;
  border-radius: 12px 12px 12px 4px;
}

.user-message .message-content {
  background: linear-gradient(135deg, #6876f7, #22c55e);
  color: white;
  border-radius: 12px 12px 4px 12px;
}

.message-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.chat-input-area {
  display: flex;
  gap: 6px;
  padding: 10px 8px;
  border-top: 1px solid #e5e7eb;
  background: white;
  flex-shrink: 0;
  box-sizing: border-box;
}

.chat-input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #4f46e5;
}

.chat-send-btn {
  background: linear-gradient(135deg, #4f46e5, #22c55e);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
  .message-content {
    max-width: 90%;
    padding: 8px 10px;
    font-size: 13px;
  }

  .chat-input {
    font-size: 13px;
    padding: 8px 14px;
  }

  .chat-input-area {
    padding: 8px 6px;
    gap: 4px;
  }

  .login-wrapper {
    flex-direction: column;
    height: auto;
    min-height: auto;
  }

  .login-branding {
    min-height: 30vh;
    padding: 16px;
  }

  .login-branding h1 {
    font-size: 28px;
  }

  .login-branding p {
    font-size: 13px;
  }

  .brand-icon {
    font-size: 48px;
    margin-bottom: 12px;
  }

  .brand-features {
    gap: 10px;
    margin-top: 15px;
  }

  .feature {
    font-size: 12px;
    gap: 8px;
  }

  .login-form-container {
    min-height: 70vh;
    padding: 16px;
  }

  h2 {
    font-size: 20px;
    margin-bottom: 16px;
  }

  .form {
    gap: 12px;
    width: 100%;
  }

  label {
    font-size: 13px;
  }

  input {
    padding: 10px;
    font-size: 16px;
  }

  button {
    padding: 10px;
    font-size: 14px;
  }

  .live-chat-widget {
    width: calc(100% - 16px);
    height: 50vh;
    bottom: 70px;
    right: 8px;
    left: 8px;
  }

  .chat-toggle-btn {
    bottom: 16px;
    right: 12px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  html, body {
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
  }

  .login-wrapper {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    width: 100%;
    padding: 0;
    margin: 0;
    gap: 0;
  }

  .login-branding {
    flex: 0;
    min-height: auto;
    padding: 12px 8px;
    width: 100%;
    order: 2;
  }

  .login-form-container {
    flex: 1;
    min-height: auto;
    padding: 12px 8px;
    width: 100%;
    order: 1;
  }

  body {
    padding: 0;
  }

  h2 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .form {
    gap: 8px;
    width: 100%;
    max-width: 95%;
  }

  label {
    font-size: 11px;
    margin-bottom: 2px;
  }

  input {
    padding: 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
  }

  .password-input-group {
    display: block;
    width: 100%;
    position: relative;
    margin-bottom: 12px;
  }

  .password-input-group input {
    padding: 10px;
    padding-right: 44px;
    font-size: 14px;
    width: 100%;
    height: 40px;
    display: block;
    box-sizing: border-box;
  }

  .toggle-password {
    position: absolute;
    right: 6px;
    top: 4px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #38bdf8;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
  }

  button {
    padding: 10px;
    font-size: 12px;
    width: 100%;
  }

  .brand-icon {
    font-size: 32px;
    margin-bottom: 6px;
  }

  .login-branding h1 {
    font-size: 18px;
    word-break: break-word;
  }

  .login-branding p {
    font-size: 11px;
    margin-bottom: 12px;
    word-break: break-word;
  }

  .brand-features {
    gap: 6px;
    margin-top: 10px;
  }

  .feature {
    font-size: 10px;
    gap: 6px;
    word-break: break-word;
  }

  .feature i {
    font-size: 14px;
    flex-shrink: 0;
  }

  .live-chat-widget {
    width: calc(100% - 8px);
    height: 60vh;
    bottom: 50px;
    right: 4px;
    left: 4px;
  }

  .chat-toggle-btn {
    bottom: 10px;
    right: 8px;
    width: 46px;
    height: 46px;
    font-size: 16px;
  }

  .mode-switch {
    margin-bottom: 6px;
  }

  .mode-btn {
    padding: 6px;
    font-size: 10px;
    gap: 4px;
  }

  .switch {
    text-align: center;
    margin-top: 8px;
  }

  .switch p {
    font-size: 10px;
    margin: 2px 0;
    word-break: break-word;
  }

  .switch a {
    font-size: 10px;
    margin-left: 2px;
  }

  .admin-login-link {
    margin-top: 6px;
    font-size: 9px;
  }

  .admin-login-link a {
    font-size: 9px;
    padding: 4px 8px;
    gap: 4px;
  }

  .error {
    font-size: 9px;
  }
}

/* Extra Small Devices (Below 370px) */
@media (max-width: 370px) {
  .login-branding {
    padding: 10px 6px;
  }

  .brand-icon {
    font-size: 28px;
    margin-bottom: 4px;
  }

  .login-branding h1 {
    font-size: 16px;
    margin-bottom: 4px;
    word-break: break-word;
  }

  .login-branding p {
    font-size: 9px;
    margin-bottom: 8px;
    word-break: break-word;
  }

  .brand-features {
    gap: 4px;
    margin-top: 6px;
  }

  .feature {
    font-size: 8px;
    gap: 4px;
    word-break: break-word;
  }

  .feature i {
    font-size: 10px;
    flex-shrink: 0;
    min-width: 10px;
  }

  .login-form-container {
    padding: 10px 6px;
  }

  .form {
    gap: 6px;
    max-width: 100%;
  }

  h2 {
    font-size: 14px;
    margin-bottom: 8px;
    word-break: break-word;
  }

  .form-group {
    margin: 0;
    gap: 3px;
  }

  label {
    font-size: 10px;
    margin-bottom: 2px;
    word-break: break-word;
  }

  input {
    padding: 8px;
    font-size: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .password-input-group {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 10px;
  }

  .password-input-group input {
    padding: 8px;
    padding-right: 36px;
    font-size: 12px;
    width: 100%;
    height: 36px;
    display: block;
    box-sizing: border-box;
  }

  .toggle-password {
    position: absolute;
    right: 4px;
    top: 2px;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 11px;
    z-index: 10;
  }

  button {
    padding: 8px;
    font-size: 11px;
    width: 100%;
    gap: 6px;
  }

  .switch {
    text-align: center;
    margin-top: 8px;
  }

  .switch p {
    font-size: 10px;
    margin: 2px 0;
    word-break: break-word;
  }

  .switch a {
    font-size: 10px;
    margin-left: 2px;
  }

  .admin-login-link {
    margin-top: 6px;
    font-size: 9px;
  }

  .admin-login-link a {
    font-size: 9px;
    padding: 4px 8px;
    gap: 4px;
  }

  .mode-switch {
    margin-bottom: 6px;
  }

  .mode-btn {
    padding: 6px;
    font-size: 10px;
    gap: 4px;
  }

  .error {
    font-size: 9px;
  }
}