/* ==========================================================================
   Modern Luxury Glassmorphic Design System
   ========================================================================== */

:root {
  --bg-main: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.75);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #8b5cf6;
  --accent-cyan: #06b6d4;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --input-bg: rgba(15, 23, 42, 0.65);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
         font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
         color: var(--text-dark);
         background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
         min-height: 100vh;
         display: flex;
         align-items: center;
         justify-content: center;
         position: relative;
         background-image: url(https://i.imgur.com/W6H22Ci.png);
         background-size: cover;
         background-position: center;
         background-attachment: fixed;
      }
/* Ambient Background Glow */
.bg-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  filter: blur(120px);
  border-radius: 50%;
  opacity: 0.35;
  animation: floatBlobs 20s ease-in-out infinite alternate;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -15%;
  left: -10%;
}

.blob-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  bottom: -15%;
  right: -10%;
  animation-delay: -7s;
}

.blob-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  top: 40%;
  right: 25%;
  animation-delay: -12s;
  opacity: 0.2;
}

@keyframes floatBlobs {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Login Card Container */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  perspective: 1000px;
}

.login-card {

      background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px 35px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
      box-shadow: 
    0 20px 45px -10px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: var(--transition);
  animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Card Header */
.card-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 20px -4px var(--primary-glow);
  margin-bottom: 18px;
  color: #a5b4fc;
}

.logo-badge svg {
  width: 28px;
  height: 28px;
}

.title {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}


.subtitle {
    text-align: center;
    font-size: 18px;
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 30px;
    line-height: 1.4;
}

/* Form Styles */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  letter-spacing: 0.01em;
}

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

.input-icon {
  position: absolute;
  right: 14px;
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

.form-control {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 20px;
  box-sizing: border-box;
  background: #f1f5f9;
  border: 2px solid #e0e7f0;
  border-radius: 12px;
  color: #64748b;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-control::placeholder {
  color: #64748b;
  opacity: 1;
}

.form-control:focus {
  border-color: #cbd5e1;
  outline: none;
}


.form-control.has-toggle {
  padding-right: 44px;
}

.checkbox {
  width: 100%;
  margin-top: 14px;
}

.checkbox .form-check {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox .form-check-input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #2563eb;
}

.checkbox .form-check-label {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.password-toggle:hover {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.input-wrapper:focus-within .input-icon {
  color: #818cf8;
}

/* Error message underneath field */
.field-error {
  font-size: 12px;
  color: #f87171;
  display: none;
}

.field-error.active {
  display: block;
}

/* Submit Button */
.btn-submit {
  position: relative;
  width: 100%;
  height: 50px;
  margin-top: 8px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 24px -6px var(--primary-glow);
  transition: var(--transition);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -6px rgba(99, 102, 241, 0.55);
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

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

.btn-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

/* Spinner inside button */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn-submit.loading .spinner {
  display: inline-block;
}

.btn-submit.loading .btn-text {
  opacity: 0.8;
}

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

/* Footer / Meta info */
.card-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.card-footer svg {
  width: 14px;
  height: 14px;
  color: #10b981;
}

/* ==========================================================================
   POPUP MODAL (Successful Login & Redirection)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 40px 32px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 
    0 25px 60px -12px rgba(0, 0, 0, 0.8),
    0 0 30px -5px var(--success-glow);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-backdrop.active .modal-box {
  transform: scale(1) translateY(0);
}

/* Animated Checkmark Circle */
.success-icon-wrap {
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkmark-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.08);
  animation: pulseSuccess 2s infinite ease-in-out;
}

@keyframes pulseSuccess {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); }
}

.checkmark-svg {
  width: 40px;
  height: 40px;
  stroke: #10b981;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.checkmark-check {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: strokeCheck 0.6s 0.25s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes strokeCheck {
  100% { stroke-dashoffset: 0; }
}

/* Modal Content */
.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 15px;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-desc strong {
  color: #34d399;
}

/* Progress bar showing redirection progress */
.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-top: 10px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 10px;
  transition: width 0.1s linear;
}

.redirect-notice {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 14px;
}

.redirect-link-manual {
  color: #818cf8;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.redirect-link-manual:hover {
  text-decoration: underline;
  color: #a5b4fc;
}

/* Alert Banner */
.alert-box {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
}

.alert-box.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
