/* static/css/components/calculator-auth-gate.css */
/* Authentication Gate for Investment Calculator */

/* Auth Gate Overlay */
.calculator-auth-gate {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
}

.calculator-auth-gate__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 8, 37, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
}

.calculator-auth-gate__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  max-width: 400px;
  width: 100%;
}

.calculator-auth-gate__icon {
  width: 64px;
  height: 64px;
  background: rgba(235, 18, 96, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.calculator-auth-gate__icon svg {
  width: 32px;
  height: 32px;
  color: #EB1260;
}

.calculator-auth-gate__title {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.calculator-auth-gate__description {
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: clamp(0.875rem, 3vw, 1rem);
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
  opacity: 0.9;
}

.calculator-auth-gate__button {
  display: inline-flex;
  padding: 12px 24px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: #EB1260;
  box-shadow: 0px 0px 0px 1px rgba(10, 13, 18, 0.18) inset, 
              0px -2px 0px 0px rgba(10, 13, 18, 0.05) inset, 
              0px 1px 2px 0px rgba(10, 13, 18, 0.05);
  
  color: #FFF;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
  min-width: 140px;
}

.calculator-auth-gate__button:hover {
  background: #C10E52;
  transform: translateY(-1px);
  text-decoration: none;
  color: #FFF;
}

.calculator-auth-gate__button:active {
  transform: translateY(0);
}

/* Auth Modal */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.auth-modal.active {
  display: flex;
}

.auth-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.auth-modal__container {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xl);
  z-index: 10;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-primary);
}

.auth-modal__title {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.auth-modal__close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: 6px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.auth-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.auth-modal__close svg {
  width: 18px;
  height: 18px;
}

.auth-modal__body {
  padding: var(--space-6);
}

/* Form Tabs */
.auth-modal__tabs {
  display: flex;
  margin-bottom: var(--space-6);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 4px;
}

.auth-modal__tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-modal__tab.active {
  background: #EB1260;
  color: #FFF;
}

.auth-modal__tab:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Form Content */
.auth-modal__form-content {
  display: none;
}

.auth-modal__form-content.active {
  display: block;
}

/* Reuse auth-form styling for consistency */
.auth-modal .auth-form {
  max-width: none;
  gap: var(--space-6);
}

.auth-modal .auth-form__form {
  gap: var(--space-5);
}

.auth-modal .auth-form__submit {
  margin-top: var(--space-2);
}

.auth-modal .auth-form__footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-primary);
}

/* Success state */
.auth-modal__success {
  text-align: center;
  padding: var(--space-8);
}

.auth-modal__success-icon {
  width: 64px;
  height: 64px;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.auth-modal__success-icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent-secondary);
}

.auth-modal__success-title {
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 var(--space-2);
}

.auth-modal__success-text {
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

/* Loading state */
.auth-modal__loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  gap: var(--space-3);
}

.auth-modal__loading.active {
  display: flex;
}

.auth-modal__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-primary);
  border-top-color: #EB1260;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.auth-modal__loading-text {
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 480px) {
  .auth-modal__container {
    max-width: calc(100% - 2rem);
    margin: var(--space-4);
  }
  
  .auth-modal__header,
  .auth-modal__body {
    padding: var(--space-4);
  }
  
  .calculator-auth-gate__overlay {
    padding: var(--space-4);
  }
  
  .calculator-auth-gate__title {
    font-size: 1.125rem;
  }
  
  .calculator-auth-gate__description {
    font-size: 0.875rem;
  }
}

@media (max-width: 320px) {
  .calculator-auth-gate__button {
    padding: 10px 16px;
    font-size: 14px;
    min-width: 120px;
  }
}

/* Focus states for accessibility */
.calculator-auth-gate__button:focus {
  outline: 2px solid #EB1260;
  outline-offset: 2px;
}

.auth-modal__close:focus {
  outline: 2px solid #EB1260;
  outline-offset: 2px;
}

.auth-modal__tab:focus {
  outline: 2px solid #EB1260;
  outline-offset: 2px;
}

/* Hide scrollbar for modal content */
.auth-modal__container::-webkit-scrollbar {
  width: 6px;
}

.auth-modal__container::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.auth-modal__container::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 3px;
}

.auth-modal__container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
