/*
 * Login Page Styles
 * Brigitte.de Design System
 */

/* ============================================
   HEADER AUTH ICONS
   ============================================ */

#headerLoginIcon {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#headerLoginIcon:hover {
  opacity: 0.7;
}

#headerLoginIcon.hidden {
  display: none;
}

.header__meta-icon--login {
  display: block;
  width: 24px;
  height: 24px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Logged in icons */
.header__auth-icons {
  display: none;
  align-items: center;
  gap: 16px;
}

.header__auth-icons.active {
  display: flex;
}

.header__auth-icon {
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.header__auth-icon:hover {
  opacity: 1;
}

.header__auth-icon--profile {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

.header__auth-icon--logout {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16,17 21,12 16,7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
  min-height: calc(100vh - 200px);
  background: linear-gradient(180deg, #fdf2f6 0%, #fff 100%);
}

.login-hero {
  text-align: center;
  padding: 100px 24px;
  max-width: 500px;
  margin: 0 auto;
}

.login-hero.hidden {
  display: none;
}

.login-hero__title {
  font-family: "Outfit", sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #000;
  margin: 0 0 16px 0;
}

.login-hero__text {
  font-family: "Outfit", sans-serif;
  font-size: 1.1rem;
  color: #666;
  line-height: 1.6;
  margin: 0 0 32px 0;
}

.login-hero__btn {
  display: inline-block;
  background: #d8115f;
  color: white;
  border: none;
  padding: 16px 48px;
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-hero__btn:hover {
  background: #b80e50;
}

/* Success state */
.login-success {
  display: none;
  text-align: center;
  padding: 100px 24px;
  max-width: 500px;
  margin: 0 auto;
}

.login-success.active {
  display: block;
}

.login-success__icon {
  width: 80px;
  height: 80px;
  background: #d8115f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.login-success__icon svg {
  width: 40px;
  height: 40px;
  stroke: white;
  stroke-width: 3;
}

.login-success__title {
  font-family: "Outfit", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #000;
  margin: 0 0 12px 0;
}

.login-success__text {
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  color: #666;
  margin: 0 0 32px 0;
}

.login-success__btn {
  display: inline-block;
  background: #d8115f;
  color: white;
  padding: 14px 32px;
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 2px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s ease;
}

.login-success__btn:hover {
  background: #b80e50;
}

/* ============================================
   LOGIN MODAL
   ============================================ */

.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.login-modal {
  background: white;
  border-radius: 4px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.login-modal-overlay.active .login-modal {
  transform: translateY(0);
}

.login-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
}

.login-modal__close:hover {
  color: #333;
}

.login-modal__header {
  padding: 40px 32px 24px;
  text-align: center;
}

.login-modal__logo {
  font-family: "Outfit", serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 8px;
}

.login-modal__title {
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  color: #666;
  margin: 0;
}

.login-modal__body {
  padding: 0 32px 32px;
}

/* ============================================
   LOGIN FORM ELEMENTS
   ============================================ */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form__label {
  font-family: "Outfit", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
  display: block;
}

.login-input {
  width: 100%;
  padding: 14px 16px;
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 2px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.login-input:focus {
  border-color: #d8115f;
}

.login-submit {
  background: #d8115f;
  color: white;
  border: none;
  padding: 14px 24px;
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.login-submit:hover {
  background: #b80e50;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.login-divider__line {
  flex: 1;
  height: 1px;
  background: #e5e5e5;
}

.login-divider__text {
  padding: 0 16px;
  color: #999;
  font-family: "Outfit", sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 2px;
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  background: white;
  border: 1px solid #ddd;
  color: #333;
  transition: all 0.2s;
}

.social-btn:hover {
  border-color: #333;
}

.form-error {
  color: #d32f2f;
  font-family: "Outfit", sans-serif;
  font-size: 0.8rem;
  margin-top: 4px;
}

.forgot-password-link {
  font-family: "Outfit", sans-serif;
  font-size: 0.8rem;
  color: #d8115f;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.forgot-password-link:hover {
  text-decoration: underline;
}

.forgot-password-link--centered {
  display: block;
  text-align: center;
  margin-top: 12px;
}

.login-info-text {
  text-align: center;
  color: #666;
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.magic-code-btn {
  width: 100%;
  padding: 12px 16px;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 2px;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  transition: all 0.2s;
}

.magic-code-btn:hover {
  background: #f0f0f0;
}

/* Magic Link Button - More Prominent */
.magic-link-btn {
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  transition: all 0.2s;
  text-align: center;
}

.magic-link-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Apple Social Button */
.social-btn--apple {
  background: #000;
  color: white;
  border: 1px solid #000;
}

.social-btn--apple:hover {
  background: #333;
  border-color: #333;
}

/* Social buttons spacing */
.social-btn + .social-btn {
  margin-top: 12px;
}

/* Reset Password Form */
.login-form__title {
  font-family: "Outfit", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #000;
  text-align: center;
  margin: 0 0 8px 0;
}

/* ============================================
   LOADING STATE
   ============================================ */

.login-modal__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 16px;
}

.login-modal__loading.hidden {
  display: none;
}

.login-modal__loading p {
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

.login-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #d8115f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Hide signin root until SDK is ready */
#signinRoot:not(:defined) {
  display: none;
}

/* Flash Message */
.flash-message {
  display: block;
  background: #e8f5e9;
  border: 1px solid #4caf50;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  color: #2e7d32;
  text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  .login-hero__title {
    font-size: 1.8rem;
  }

  .login-modal__header,
  .login-modal__body {
    padding-left: 24px;
    padding-right: 24px;
  }
}
