/* ========== AUTH VIEWS ========== */
.auth-view {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  overflow-y: auto;
  padding: 24px;
  gap: 24px;
}
#login-view { gap: 32px; }

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.auth-icon {
  width: 64px;
  height: 64px;
  background: var(--color-primary);
  border-radius: var(--radius-container);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-icon svg {
  width: 32px;
  height: 32px;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.36px;
  text-align: center;
}
.auth-title.brand-title {
  font-size: 34px;
  letter-spacing: 0.4px;
}
.auth-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.25px;
  text-align: center;
}

/* Header group for signup/forgot */
.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
#forgot-view .auth-header {
  gap: 8px;
}

/* Form card wrapper */
.auth-form-card {
  background: var(--color-card);
  border-radius: var(--radius-card);
  padding: 20px 16px;
  width: 100%;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.08px;
}
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-field input {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: var(--radius-input);
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  outline: none;
  background: var(--color-bg);
}
.auth-field input:focus {
  box-shadow: 0 0 0 2px var(--color-primary);
}
.auth-field input::placeholder {
  color: #c7c7cc;
}
.auth-field .input-error {
  box-shadow: 0 0 0 2px var(--color-danger);
}
.auth-field .error-msg {
  font-size: 12px;
  color: var(--color-danger);
  display: none;
}
.auth-field .error-msg.visible {
  display: block;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}
.password-toggle svg {
  width: 18px;
  height: 18px;
}

/* Buttons */
.auth-btn {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-card);
  border: none;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.43px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.auth-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.auth-btn .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}
.auth-btn.loading .spinner { display: block; }
.auth-btn.loading .btn-label { display: none; }

.auth-link {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-primary);
  letter-spacing: -0.25px;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

/* Forgot password link inside form card */
.forgot-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: -0.15px;
  text-align: right;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  align-self: flex-end;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.auth-divider-line {
  flex: 1;
  height: 0.5px;
  background: var(--border-color);
}
.auth-divider-text {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.08px;
  white-space: nowrap;
}

/* SSO */
.sso-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sso-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sso-btn {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  background: var(--color-card);
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.43px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.sso-btn img {
  width: 20px;
  height: 20px;
}
.sso-btn .ms-logo {
  width: 20px;
  height: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
}
.sso-btn .ms-logo span {
  display: block;
}

/* Server error banner */
.auth-server-error {
  display: none;
  background: #FFF0F0;
  color: var(--color-danger);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius-input);
  text-align: center;
}
.auth-server-error.visible {
  display: block;
}

/* Footer */
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.auth-footer-text {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: -0.15px;
}
.auth-footer-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: -0.15px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

/* Back to sign in link */
.back-to-signin {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: -0.15px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.back-to-signin svg {
  width: 14px;
  height: 14px;
}
