:root {
  --primary: #1a56db; /* Theme blue color */
  --primary-hover: #1e40af;
  --text: #1a56db; /* Changed to theme blue */
  --text-light: #6b7280;
  --background: #f8fafc;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --input-bg: #ffffff;
  --input-focus: #1a56db;
  --error: #dc2626;
  --success: #10b981;
  --muted: #6b7280;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  
  /* Text colors */
  --heading-color: #1a56db;
  --link-color: #1a56db;
  --link-hover: #1e40af;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --text-light: #94a3b8;
    --border: #334155;
    --input-bg: #1e293b;
    --input-focus: #60a5fa;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --heading-color: #ffffff;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
  }
  
  .gifto-login-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
  }
  
  /* Dark mode specific header adjustments */
  .gifto-login-header::before {
    background-image: 
      radial-gradient(circle at 10% 20%, rgba(0,0,0,0.1) 0%, transparent 20%),
      radial-gradient(circle at 90% 80%, rgba(0,0,0,0.1) 0%, transparent 20%);
  }
}

/* Base styles */
body {
  background-color: var(--background);
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Base container styles */
.gifto-login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Desktop styles */
@media (min-width: 769px) {
  .gifto-login-container {
    max-width: 100%;
    width: 100%;
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
  }
  
  .gifto-login-card {
    border-radius: 1rem;
    max-width: 800px; /* Increased from 600px */
    width: 100%;
    margin: 0 auto;
  }
  
  .gifto-login-header {
    padding: 3rem 3rem 2.5rem;
    border-radius: 1rem 1rem 0 0;
  }
  
  .gifto-login-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
  }
  
  .gifto-login-logo svg {
    width: 50px;
    height: 50px;
  }
  
  .gifto-login-form {
    padding: 2.5rem 3rem;
  }
  
  .gifto-login-footer {
    padding: 1.5rem 3rem;
  }
}

.gifto-login-card {
  width: 100%;
  max-width: 100%;
  background-color: var(--card-bg);
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
  overflow: visible;
  transition: all 0.3s ease;
  margin: 0;
}

/* Modern Header Styles */
.gifto-login-header {
    padding: 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Subtle pattern overlay for depth */
.gifto-login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255,255,255,0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255,255,255,0.1) 0%, transparent 20%);
    pointer-events: none;
}

/* Logo container */
.gifto-login-logo {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Logo SVG */
.gifto-login-logo svg {
    width: 40px;
    height: 40px;
    color: white;
    transition: transform 0.3s ease;
}

/* Title styles */
.gifto-login-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.5rem 0 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

/* Subtle underline effect */
.gifto-login-header h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    margin: 0.75rem auto 0;
    border-radius: 3px;
}

/* Subtitle */
.gifto-login-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0.75rem 0 0;
    font-weight: 400;
    opacity: 0.9;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .gifto-login-header {
        background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    }
    
    .gifto-login-logo {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .gifto-login-header h2 {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

/* Hover effects */
.gifto-login-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.gifto-login-logo:hover svg {
    transform: scale(1.1);
}

/* Responsive adjustments */
/* Mobile styles */
@media (max-width: 480px) {
    .gifto-login-container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .gifto-login-header {
        padding: 1.5rem 1rem;
        border-radius: 0.5rem 0.5rem 0 0;
    }
    
    .gifto-login-logo {
        width: 70px;
        height: 70px;
    }
    
    .gifto-login-logo svg {
        width: 36px;
        height: 36px;
    }
    
    .gifto-login-header h2 {
        font-size: 1.5rem;
    }
}

.gifto-login-header h2 {
  color: white;
  margin: 0.5rem 0 0.25rem;
}

.gifto-login-header p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-size: 1rem;
}

.gifto-login-logo {
  max-width: 160px;
  height: auto;
  margin: 0 auto 1.25rem;
  display: block;
}

.gifto-login-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--heading-color);
  margin: 1rem 0 0.5rem;
  line-height: 1.25;
}

.gifto-login-form {
  padding: 2rem;
}

/* Form elements */
.gifto-form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.gifto-form-actions {
  margin: 1.5rem 0;
}

.gifto-remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gifto-remember-me input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.gifto-remember-me label {
  font-size: 0.9375rem;
  color: var(--text);
  margin: 0;
  cursor: pointer;
}

.gifto-form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
  font-size: 0.9375rem;
}

.gifto-form-control {
  position: relative;
  width: 100%;
}

.gifto-form-control input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.gifto-form-control input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

/* Password field container */
.gifto-password-field {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Password input field */
.gifto-password-field input[type="password"],
.gifto-password-field input[type="text"] {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    box-sizing: border-box;
    height: 2.75rem;
    border: 1px solid var(--border, #d1d5db);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    margin: 0;
    background-color: var(--input-bg, #ffffff);
    color: var(--text, #1a56db);
    transition: all 0.2s ease;
}

/* Password toggle button */
.gifto-password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none;
    color: var(--text-light, #6b7280);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    height: 24px;
    width: 24px;
    margin: 0;
    z-index: 10;
    box-shadow: none !important;
    line-height: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.gifto-password-toggle:hover,
.gifto-password-toggle:focus,
.gifto-password-toggle:active {
    background: none !important;
    box-shadow: none !important;
    outline: none;
}

.gifto-password-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
    margin: 0;
    background: none !important;
    pointer-events: none;
    color: var(--text-light, #6b7280);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: color 0.2s ease;
}

.gifto-password-toggle[aria-pressed="true"] svg {
    color: var(--primary, #4f46e5);
}

.gifto-password-toggle:hover {
    color: var(--primary, #4f46e5);
    background: none;
}

.gifto-password-toggle:focus {
    outline: none;
    color: var(--primary, #4f46e5);
}

/* Buttons */
.gifto-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  color: white;
  background-color: var(--primary);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.gifto-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.gifto-button.is-loading {
  pointer-events: none;
  opacity: 0.6;
}

.gifto-spinner {
  display: none; /* Hide spinner by default */
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: gifto-spin 1s ease-in-out infinite;
}

.gifto-button.is-loading .gifto-spinner {
  display: inline-block; /* Only show when parent has is-loading class */
}

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

/* Links and text */
.gifto-forgot-password {
  color: var(--link-color);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.gifto-forgot-password:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.gifto-login-footer {
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.875rem;
}

.gifto-login-footer a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.gifto-login-footer a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .gifto-login-container {
    padding: 1rem;
  }
  
  .gifto-login-card {
    border-radius: 0.5rem;
  }
  
  .gifto-login-header {
    padding: 2rem 1.5rem 1.25rem;
  }
  
  .gifto-login-form {
    padding: 1.5rem;
  }
}

/* Form validation */
.gifto-form-group.has-error .gifto-form-control input {
  border-color: var(--error);
}

.gifto-form-error {
  color: var(--error);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

.gifto-social-login {
  margin-top: 1.5rem;
  text-align: center;
  position: relative;
}

.gifto-social-login-title {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9375rem;
  margin: 0 0 1rem;
  position: relative;
  z-index: 1;
}

/* Form error styles */
.gifto-form-group.has-error .gifto-form-control {
    border-color: #ef4444;
}

.gifto-form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    line-height: 1.25;
}

/* Loading state */
.gifto-login-button.is-loading .gifto-button-text {
    visibility: hidden;
}

.gifto-login-button.is-loading .gifto-spinner {
    display: inline-block;
}

.gifto-spinner {
    display: none;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: gifto-spin 0.8s ease-in-out infinite;
}

@keyframes gifto-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Slide to verify challenge */
.gifto-slide-verify-container {
    margin: 1.5rem 0;
    position: relative;
}

.gifto-slide-verify-track {
    position: relative;
    height: 50px;
    background-color: #f1f5f9;
    border-radius: 25px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    touch-action: none; /* Prevent browser touch actions */
}

.gifto-slide-verify-thumb {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 42px;
    height: 42px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 3;
    transition: transform 0.6s cubic-bezier(0.2, 0, 0.1, 1);
    cursor: grab;
    user-select: none;
    will-change: transform;
}

.gifto-slide-verify-thumb:active {
    cursor: grabbing;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.gifto-slide-verify-thumb svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    transition: color 0.3s ease;
}

.gifto-slide-verify-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    user-select: none;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.gifto-slide-verify-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: #e0f2fe;
    transition: width 0.6s cubic-bezier(0.2, 0, 0.1, 1);
    z-index: 1;
}

.gifto-slide-verify-target {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
    pointer-events: none;
    border: 2px solid var(--primary);
}

.gifto-slide-verify-target svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Verified state */
.gifto-slide-verify-container.verified .gifto-slide-verify-track {
    background-color: #f1f5f9;
}

.gifto-slide-verify-container.verified .gifto-slide-verify-thumb {
    transition: transform 0.8s cubic-bezier(0.2, 0, 0.1, 1);
}

.gifto-slide-verify-container.verified .gifto-slide-verify-thumb svg {
    color: white;
}

.gifto-slide-verify-container.verified .gifto-slide-verify-progress {
    transition: width 0.8s cubic-bezier(0.2, 0, 0.1, 1);
}

.gifto-slide-verify-container.verified .gifto-slide-verify-text {
    color: var(--primary);
    font-weight: 600;
}

.gifto-slide-verify-container.verified .gifto-slide-verify-target {
    background-color: var(--primary);
    border-color: var(--primary);
}

.gifto-slide-verify-container.verified .gifto-slide-verify-target svg {
    color: white;
    opacity: 1;
}

.gifto-slide-verify-container.error .gifto-slide-verify-track {
    animation: shake 0.5s ease-in-out;
}

/* Disabled login button */
.gifto-login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.gifto-login-button:disabled:hover {
    background-color: var(--primary);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Auto-fill error message */
.gifto-auto-fill-error {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
    padding: 0.5rem;
    background-color: #fff5f5;
    border-radius: 0.25rem;
    border: 1px solid #fed7d7;
}

/* Loading state for form submission */
.gifto-form-submitting .gifto-login-button {
    pointer-events: none;
    opacity: 0.8;
}

.gifto-form-submitting .gifto-spinner {
    display: inline-block;
}
