/* ============================================
   TheraPieces Auth Pages - Unique Styling
   All classes prefixed with .tp-auth- to avoid conflicts
   ============================================ */

/* Auth Page Background */
.tp-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f75bc 0%, #ed2324 100%);
  background-image: 
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.07" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,144C960,149,1056,139,1152,122.7C1248,107,1344,85,1392,74.7L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"/></svg>'),
    linear-gradient(100deg, #0f75bc 0%, #ed2324 100%);
  background-repeat: no-repeat;
  background-position: bottom, center;
  background-size: cover, cover;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

/* Animated background effect */
.tp-auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(100px);
  -webkit-backdrop-filter: blur(100px);
  background: rgba(255, 255, 255, 0.7);
  animation: tp-auth-backgroundShift 15s ease-in-out infinite;
  z-index: 0;
}

@keyframes tp-auth-backgroundShift {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Auth Container */
.tp-auth-container {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Auth Card */
.tp-auth-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 40px;
  animation: tp-auth-slideUp 0.6s ease-out;
}

@keyframes tp-auth-slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auth Header */
.tp-auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.tp-auth-logo {
  max-width: 200px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.tp-auth-logo:hover {
  transform: scale(1.05);
}

.tp-auth-title {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.tp-auth-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin: 0;
  font-weight: 400;
}

/* Auth Form */
.tp-auth-form {
  margin-bottom: 24px;
}

.tp-auth-form-group {
  margin-bottom: 20px;
  position: relative;
}

.tp-auth-form-label {
  position: absolute;
  left: 16px;
  top: 13px;
  font-size: 15px;
  font-weight: 400;
  color: #9ca3af;
  pointer-events: none;
  transition: all 0.2s ease;
  background: #ffffff;
  padding: 0 4px;
}

.tp-auth-form-input:focus + .tp-auth-form-label,
.tp-auth-form-input:not(:placeholder-shown) + .tp-auth-form-label {
  top: -8px;
  left: 12px;
  font-size: 12px;
  color: #0f75bc;
  font-weight: 500;
}

.tp-auth-form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  transition: all 0.2s ease;
  color: #1a1a1a;
  box-sizing: border-box;
}

.tp-auth-form-input:focus {
  outline: none;
  border-color: #0f75bc;
  box-shadow: 0 0 0 3px rgba(15, 117, 188, 0.1);
}

.tp-auth-form-input::placeholder {
  color: transparent;
}

.tp-auth-form-input.ng-invalid.ng-touched {
  border-color: #ef4444;
}

.tp-auth-form-input.ng-invalid.ng-touched:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.tp-auth-form-input.ng-invalid.ng-touched + .tp-auth-form-label {
  color: #ef4444;
}

/* Primary Button */
.tp-auth-btn-primary {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: #1975BA;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(25, 117, 186, 0.3);
  margin-top: 8px;
}

.tp-auth-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 117, 186, 0.4);
}

.tp-auth-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Secondary Button */
.tp-auth-btn-secondary {
  display: inline-block;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  color: #1975BA;
  background: #ffffff;
  border: 2px solid #1975BA;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tp-auth-btn-secondary:hover {
  background: #1975BA;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(25, 117, 186, 0.3);
  text-decoration: none;
}

/* Auth Footer */
.tp-auth-footer {
  text-align: center;
}

.tp-auth-link-group {
  margin: 16px 0;
}

.tp-auth-text {
  font-size: 14px;
  color: #6b7280;
  margin-right: 6px;
}

.tp-auth-link {
  font-size: 14px;
  color: #1975BA;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.tp-auth-link:hover {
  color: #0d5a8f;
  text-decoration: underline;
}

.tp-auth-link-primary {
  font-size: 14px;
  color: #1975BA;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.tp-auth-link-primary:hover {
  color: #0d5a8f;
}

/* Divider */
.tp-auth-divider {
  position: relative;
  margin: 24px 0;
  text-align: center;
}

.tp-auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e5e7eb;
}

.tp-auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 16px;
  background: #ffffff;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
}

/* Loading States */
.tp-auth-loading-container {
  text-align: center;
  padding: 40px 0;
}

.tp-auth-loading {
  display: block;
  margin: 20px auto;
  width: 60px;
  height: 60px;
}

.tp-auth-loading-text {
  font-size: 15px;
  color: #6b7280;
  margin-top: 16px;
  font-weight: 500;
}

/* Signup Success Page */
.tp-auth-signup-success {
  text-align: center;
  padding: 20px 0;
}

.tp-auth-success-icon-container {
  margin: 24px 0;
}

.tp-auth-success-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #0f75bc 0%, #ed2324 100%);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(15, 117, 188, 0.3);
  animation: tp-auth-iconPulse 2s ease-in-out infinite;
}

@keyframes tp-auth-iconPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(15, 117, 188, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(15, 117, 188, 0.4);
  }
}

.tp-auth-success-icon {
  font-size: 48px;
  color: #ffffff;
}

.tp-auth-success-title {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 24px 0 12px 0;
}

.tp-auth-success-subtitle {
  font-size: 16px;
  color: #6b7280;
  margin: 0 0 32px 0;
  font-weight: 500;
}

.tp-auth-success-message {
  background: #f9fafb;
  border-radius: 8px;
  padding: 24px;
  margin: 24px 0;
  border: 1px solid #e5e7eb;
}

.tp-auth-success-message p {
  font-size: 15px;
  color: #374151;
  line-height: 1.6;
  margin: 8px 0;
}

.tp-auth-success-message strong {
  color: #1975BA;
  font-weight: 600;
}

.tp-auth-success-note {
  font-size: 13px !important;
  color: #9ca3af !important;
  margin-top: 12px !important;
}

.tp-auth-success-footer {
  margin-top: 32px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tp-auth-card {
    padding: 32px 24px;
  }
  
  .tp-auth-title {
    font-size: 24px;
  }
  
  .tp-auth-subtitle {
    font-size: 14px;
  }
  
  .tp-auth-logo {
    max-width: 160px;
  }
}

@media (max-width: 480px) {
  .tp-auth-page {
    padding: 12px;
  }
  
  .tp-auth-card {
    padding: 24px 20px;
  }
  
  .tp-auth-title {
    font-size: 22px;
  }
  
  .tp-auth-form-input {
    padding: 10px 14px;
    font-size: 14px;
  }
  
  .tp-auth-btn-primary {
    padding: 12px 20px;
    font-size: 15px;
  }
}


/* ============================================
   Additional TheraPieces Auth Styles
   Password hint and special component styling
   ============================================ */

/* Password Hint Icon */
.tp-auth-password-hint {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s ease;
  z-index: 10;
}

.tp-auth-password-hint:hover {
  color: #1975BA;
}

.tp-auth-password-hint .glyphicon {
  font-size: 16px;
}

/* Adjust form group with password hint */
.tp-auth-form-group:has(.tp-auth-password-hint) .tp-auth-form-input {
  padding-right: 44px;
}

/* Disabled input styling */
.tp-auth-form-input:disabled {
  background-color: #f9fafb;
  color: #6b7280;
  cursor: not-allowed;
  border-color: #e5e7eb;
}

.tp-auth-form-input:disabled + .tp-auth-form-label {
  color: #9ca3af;
}

/* Error states for validation */
.tp-auth-error-message {
  font-size: 13px;
  color: #ef4444;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tp-auth-error-icon {
  font-size: 14px;
}

/* Success states */
.tp-auth-success-border {
  border-color: #10b981 !important;
}

.tp-auth-success-border:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Loading spinner for button */
.tp-auth-btn-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: tp-auth-spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* Custom popover styling for password requirements */
.popover {
  max-width: 300px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.popover-content {
  padding: 12px 16px;
  font-size: 13px;
  color: #374151;
}

.popover-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.popover-content li {
  margin: 4px 0;
  color: #6b7280;
}

/* Alert styling for different states */
.tp-auth-alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tp-auth-alert-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.tp-auth-alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.tp-auth-alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.tp-auth-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.tp-auth-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .tp-auth-password-hint {
    right: 12px;
  }
  
  .tp-auth-form-group:has(.tp-auth-password-hint) .tp-auth-form-input {
    padding-right: 40px;
  }
  
  .tp-auth-success-icon-circle {
    width: 80px;
    height: 80px;
  }
  
  .tp-auth-success-icon {
    font-size: 36px;
  }
  
  .tp-auth-success-title {
    font-size: 22px;
  }
}


.tp-password-group {
  position: relative;
}

.tp-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #666;
  transition: color 0.2s ease;
  outline: none;
}

.tp-password-toggle:hover {
  color: #333;
}

.tp-password-toggle:focus {
  outline: none;
}

.tp-password-toggle .glyphicon {
  font-size: 16px;
}

/* Adjust input padding to make room for the toggle button */
.tp-password-group .tp-auth-form-input {
  padding-right: 45px;
}