/* GenoBank Auth - Unified Authentication Styles */

:root {
  --primary-color: #009ABB;
  --primary-hover: #344DA1;
  --secondary-color: #49BA80;
  --tertiary-color: #B03C96;
  --success-color: #49BA80;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #009ABB;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-radius: 0.75rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --genobank-gradient: linear-gradient(135deg, #49BA80 0%, #009ABB 33%, #344DA1 66%, #B03C96 100%);
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
}

/* Card Styling */
.card {
  border-radius: 1.5rem !important;
  overflow: hidden;
  transition: var(--transition);
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
  border-color: rgba(0, 154, 187, 0.2);
}

/* Logo and Header */
.display-6 {
  background: linear-gradient(135deg, var(--primary-color), #00b4d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Form Controls */
.form-control {
  border: 2px solid #e9ecef;
  transition: var(--transition);
  font-size: 1rem;
  padding: 0.75rem 1rem;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.1);
}

.form-control.is-invalid {
  border-color: var(--danger-color);
}

/* Buttons */
.btn {
  font-weight: 600;
  padding: 0.875rem 1.75rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.025em;
}

.btn-primary {
  background: var(--genobank-gradient);
  border: none;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 154, 187, 0.3);
  background: var(--genobank-gradient);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: left;
  padding: 1rem 1.75rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  position: relative;
  z-index: 1;
}

.auth-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--genobank-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  border-radius: inherit;
}

.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  color: white !important;
}

.auth-btn:hover:not(:disabled)::before {
  opacity: 1;
}

/* Specific button gradients */
.btn-outline-dark:hover {
  border-color: transparent;
}

.btn-outline-danger:hover {
  border-color: transparent;
}

.btn-outline-info:hover {
  border-color: transparent;
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Auth Icons */
.auth-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Spinner */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

/* Divider */
.divider {
  text-align: center;
  position: relative;
  margin: 2rem 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #dee2e6;
  transform: translateY(-50%);
}

.divider-text {
  background-color: white;
  padding: 0 1rem;
  position: relative;
  color: #6c757d;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Alerts */
.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}

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

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive Design */
@media (max-width: 576px) {
  .card-body {
    padding: 2rem !important;
  }
  
  .display-6 {
    font-size: 1.75rem;
  }
  
  .btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  }
  
  .card {
    background-color: #1e1e2e;
    color: #e9ecef;
  }
  
  .form-control {
    background-color: #2a2a3e;
    border-color: #3a3a4e;
    color: #e9ecef;
  }
  
  .form-control:focus {
    background-color: #2a2a3e;
    border-color: var(--primary-color);
    color: #e9ecef;
  }
  
  .btn-outline-dark {
    color: #e9ecef;
    border-color: #6c757d;
  }
  
  .btn-outline-dark:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
  }
  
  .divider::before {
    background-color: #3a3a4e;
  }
  
  .divider-text {
    background-color: #1e1e2e;
    color: #9ca3af;
  }
  
  .text-muted {
    color: #9ca3af !important;
  }
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 102, 204, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 102, 204, 0);
  }
}

.btn-primary:not(:disabled):active {
  animation: pulse 0.5s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Focus Styles */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus,
input:focus {
  outline-offset: 4px;
}

/* Link Styles */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Success Animation */
.success-check {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Error Shake Animation */
.shake {
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* QR Code Modal Styles */
.qr-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.qr-modal-content {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  max-width: 400px;
  width: 90%;
  animation: slideUp 0.3s ease;
}

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

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

.qr-code-container {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.qr-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  transition: var(--transition);
}

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

/* GenoBank Logo Styling */
img[alt="GenoBank.io"] {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: var(--transition);
}

img[alt="GenoBank.io"]:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

/* Enhanced Typography */
h2.h4 {
  font-weight: 700;
  background: var(--genobank-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

/* Background Enhancement */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(73, 186, 128, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 154, 187, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(52, 77, 161, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Button Icons Animation */
.auth-icon {
  transition: transform 0.3s ease;
}

.auth-btn:hover .auth-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Success State Animation */
.auth-success {
  background: var(--genobank-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Card Entry Animation */
@keyframes cardEntry {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card {
  animation: cardEntry 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button Pulse Effect */
@keyframes gentlePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 154, 187, 0.2);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0, 154, 187, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 154, 187, 0);
  }
}

.auth-btn:focus {
  animation: gentlePulse 1.5s infinite;
}

/* Footer Link Enhancement */
small a {
  font-weight: 500;
  background: var(--genobank-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

small a:hover {
  text-decoration: none;
  opacity: 0.8;
}